OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "../../../core/include/fxcrt/fx_basic.h" | 7 #include "../../../core/include/fxcrt/fx_basic.h" |
8 #include "../../../core/include/fxcrt/fx_ext.h" | 8 #include "../../../core/include/fxcrt/fx_ext.h" |
9 #include "../../include/jsapi/fxjs_v8.h" | 9 #include "../../include/jsapi/fxjs_v8.h" |
10 #include "../../include/fsdk_define.h" | 10 #include "../../include/fsdk_define.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #define VALUE_NAME_NULL L"null" | 21 #define VALUE_NAME_NULL L"null" |
22 #define VALUE_NAME_UNDEFINED L"undefined" | 22 #define VALUE_NAME_UNDEFINED L"undefined" |
23 | 23 |
24 const static FX_DWORD g_nan[2] = {0,0x7FF80000 }; | 24 const static FX_DWORD g_nan[2] = {0,0x7FF80000 }; |
25 static double GetNan() | 25 static double GetNan() |
26 { | 26 { |
27 return *(double*)g_nan; | 27 return *(double*)g_nan; |
28 } | 28 } |
29 | 29 |
30 | 30 |
31 class CJS_PrivateData: public CFX_Object | 31 class CJS_PrivateData |
32 { | 32 { |
33 public: | 33 public: |
34 CJS_PrivateData():ObjDefID(-1), pPrivate(NULL) {} | 34 CJS_PrivateData():ObjDefID(-1), pPrivate(NULL) {} |
35 int ObjDefID; | 35 int ObjDefID; |
36 FX_LPVOID pPrivate; | 36 FX_LPVOID pPrivate; |
37 }; | 37 }; |
38 | 38 |
39 | 39 |
40 class CJS_ObjDefintion: public CFX_Object | 40 class CJS_ObjDefintion |
41 { | 41 { |
42 public: | 42 public: |
43 CJS_ObjDefintion(v8::Isolate* isolate, const wchar_t* sObjName, FXJSOBJT
YPE eObjType, LP_CONSTRUCTOR pConstructor, LP_DESTRUCTOR pDestructor, unsigned b
ApplyNew): | 43 CJS_ObjDefintion(v8::Isolate* isolate, const wchar_t* sObjName, FXJSOBJT
YPE eObjType, LP_CONSTRUCTOR pConstructor, LP_DESTRUCTOR pDestructor, unsigned b
ApplyNew): |
44 objName(sObjName), objType(eObjType), m_pConstructor(pConstructor), m_
pDestructor(pDestructor),m_bApplyNew(bApplyNew),m_bSetAsGlobalObject(FALSE) | 44 objName(sObjName), objType(eObjType), m_pConstructor(pConstructor), m_
pDestructor(pDestructor),m_bApplyNew(bApplyNew),m_bSetAsGlobalObject(FALSE) |
45 { | 45 { |
46 v8::Isolate::Scope isolate_scope(isolate); | 46 v8::Isolate::Scope isolate_scope(isolate); |
47 v8::HandleScope handle_scope(isolate); | 47 v8::HandleScope handle_scope(isolate); |
48 | 48 |
49 v8::Handle<v8::ObjectTemplate> objTemplate = v8::ObjectTemplat
e::New(isolate); | 49 v8::Handle<v8::ObjectTemplate> objTemplate = v8::ObjectTemplat
e::New(isolate); |
50 objTemplate->SetInternalFieldCount(1); | 50 objTemplate->SetInternalFieldCount(1); |
(...skipping 993 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1044 { | 1044 { |
1045 return d != d; | 1045 return d != d; |
1046 } | 1046 } |
1047 | 1047 |
1048 double JS_LocalTime(double d) | 1048 double JS_LocalTime(double d) |
1049 { | 1049 { |
1050 return JS_GetDateTime() + _getDaylightSavingTA(d); | 1050 return JS_GetDateTime() + _getDaylightSavingTA(d); |
1051 } | 1051 } |
1052 | 1052 |
1053 //JavaScript time implement End. | 1053 //JavaScript time implement End. |
OLD | NEW |