v8 14.1.146 (node 25.0.0)
V8 is Google's open source JavaScript engine
Loading...
Searching...
No Matches
v8-date.h
Go to the documentation of this file.
1// Copyright 2021 the V8 project authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef INCLUDE_V8_DATE_H_
6#define INCLUDE_V8_DATE_H_
7
8#include "v8-local-handle.h" // NOLINT(build/include_directory)
9#include "v8-object.h" // NOLINT(build/include_directory)
10#include "v8config.h" // NOLINT(build/include_directory)
11
12namespace v8 {
13
14class Context;
15
16/**
17 * An instance of the built-in Date constructor (ECMA-262, 15.9).
18 */
19class V8_EXPORT Date : public Object {
20 public:
22 double time);
23
25 Local<Context> context,
26 Local<String> date_string);
27
28 /**
29 * A specialization of Value::NumberValue that is more efficient
30 * because we know the structure of this object.
31 */
32 double ValueOf() const;
33
34 /**
35 * Generates ISO string representation.
36 */
38
39 /**
40 * Generates UTC string representation.
41 */
43
44 V8_INLINE static Date* Cast(Value* value) {
45#ifdef V8_ENABLE_CHECKS
46 CheckCast(value);
47#endif
48 return static_cast<Date*>(value);
49 }
50
51 private:
52 static void CheckCast(Value* obj);
53};
54
55} // namespace v8
56
57#endif // INCLUDE_V8_DATE_H_
v8::Local< v8::String > ToUTCString() const
static V8_WARN_UNUSED_RESULT MaybeLocal< Value > Parse(Local< Context > context, Local< String > date_string)
static V8_INLINE Date * Cast(Value *value)
Definition v8-date.h:44
static V8_WARN_UNUSED_RESULT MaybeLocal< Value > New(Local< Context > context, double time)
double ValueOf() const
v8::Local< v8::String > ToISOString() const
friend class Local
friend class MaybeLocal
#define V8_EXPORT
Definition v8config.h:860
#define V8_INLINE
Definition v8config.h:513
#define V8_WARN_UNUSED_RESULT
Definition v8config.h:684