Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-21 10:05:23

0001 // Copyright 2021 the V8 project authors. All rights reserved.
0002 // Use of this source code is governed by a BSD-style license that can be
0003 // found in the LICENSE file.
0004 
0005 #ifndef INCLUDE_V8_DATE_H_
0006 #define INCLUDE_V8_DATE_H_
0007 
0008 #include "v8-local-handle.h"  // NOLINT(build/include_directory)
0009 #include "v8-object.h"        // NOLINT(build/include_directory)
0010 #include "v8config.h"         // NOLINT(build/include_directory)
0011 
0012 namespace v8 {
0013 
0014 class Context;
0015 
0016 /**
0017  * An instance of the built-in Date constructor (ECMA-262, 15.9).
0018  */
0019 class V8_EXPORT Date : public Object {
0020  public:
0021   static V8_WARN_UNUSED_RESULT MaybeLocal<Value> New(Local<Context> context,
0022                                                      double time);
0023 
0024   /**
0025    * A specialization of Value::NumberValue that is more efficient
0026    * because we know the structure of this object.
0027    */
0028   double ValueOf() const;
0029 
0030   /**
0031    * Generates ISO string representation.
0032    */
0033   v8::Local<v8::String> ToISOString() const;
0034 
0035   V8_INLINE static Date* Cast(Value* value) {
0036 #ifdef V8_ENABLE_CHECKS
0037     CheckCast(value);
0038 #endif
0039     return static_cast<Date*>(value);
0040   }
0041 
0042  private:
0043   static void CheckCast(Value* obj);
0044 };
0045 
0046 }  // namespace v8
0047 
0048 #endif  // INCLUDE_V8_DATE_H_