Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(170)

Side by Side Diff: fpdfsdk/src/jsapi/fxjs_v8.cpp

Issue 1338003004: Merge to XFA: Fix strings, ..., void return types for Consts.h. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/src/javascript/global.cpp ('k') | testing/resources/javascript/consts.in » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "time.h" 11 #include "time.h"
12 #include <cmath> 12 #include <cmath>
13 #include <limits> 13 #include <limits>
14 14
15 #define VALUE_NAME_STRING L"string" 15 const wchar_t kFXJSValueNameString[] = L"string";
16 #define VALUE_NAME_NUMBER L"number" 16 const wchar_t kFXJSValueNameNumber[] = L"number";
17 #define VALUE_NAME_BOOLEAN L"boolean" 17 const wchar_t kFXJSValueNameBoolean[] = L"boolean";
18 #define VALUE_NAME_DATE L"date" 18 const wchar_t kFXJSValueNameDate[] = L"date";
19 #define VALUE_NAME_OBJECT L"object" 19 const wchar_t kFXJSValueNameObject[] = L"object";
20 #define VALUE_NAME_FXOBJ L"fxobj" 20 const wchar_t kFXJSValueNameFxobj[] = L"fxobj";
21 #define VALUE_NAME_NULL L"null" 21 const wchar_t kFXJSValueNameNull[] = L"null";
22 #define VALUE_NAME_UNDEFINED L"undefined" 22 const wchar_t kFXJSValueNameUndefined[] = 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 return *(double*)g_nan; 26 return *(double*)g_nan;
27 } 27 }
28 static unsigned int g_embedderDataSlot = 0u; 28 static unsigned int g_embedderDataSlot = 0u;
29 29
30 class CJS_PrivateData { 30 class CJS_PrivateData {
31 public: 31 public:
32 CJS_PrivateData() : ObjDefID(-1), pPrivate(NULL) {} 32 CJS_PrivateData() : ObjDefID(-1), pPrivate(NULL) {}
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 if (!pArray) { 86 if (!pArray) {
87 pArray = new CFX_PtrArray(); 87 pArray = new CFX_PtrArray();
88 pIsolate->SetData(g_embedderDataSlot, pArray); 88 pIsolate->SetData(g_embedderDataSlot, pArray);
89 } 89 }
90 CJS_ObjDefintion* pObjDef = new CJS_ObjDefintion(pIsolate, sObjName, eObjType, 90 CJS_ObjDefintion* pObjDef = new CJS_ObjDefintion(pIsolate, sObjName, eObjType,
91 pConstructor, pDestructor); 91 pConstructor, pDestructor);
92 pArray->Add(pObjDef); 92 pArray->Add(pObjDef);
93 return pArray->GetSize() - 1; 93 return pArray->GetSize() - 1;
94 } 94 }
95 95
96 int JS_DefineObjMethod(v8::Isolate* pIsolate, 96 void JS_DefineObjMethod(v8::Isolate* pIsolate,
97 int nObjDefnID, 97 int nObjDefnID,
98 const wchar_t* sMethodName, 98 const wchar_t* sMethodName,
99 v8::FunctionCallback pMethodCall) { 99 v8::FunctionCallback pMethodCall) {
100 v8::Isolate::Scope isolate_scope(pIsolate); 100 v8::Isolate::Scope isolate_scope(pIsolate);
101 v8::HandleScope handle_scope(pIsolate); 101 v8::HandleScope handle_scope(pIsolate);
102 102
103 CFX_WideString ws = CFX_WideString(sMethodName); 103 CFX_WideString ws = CFX_WideString(sMethodName);
104 CFX_ByteString bsMethodName = ws.UTF8Encode(); 104 CFX_ByteString bsMethodName = ws.UTF8Encode();
105 CFX_PtrArray* pArray = (CFX_PtrArray*)pIsolate->GetData(g_embedderDataSlot);
105 106
106 CFX_PtrArray* pArray = (CFX_PtrArray*)pIsolate->GetData(g_embedderDataSlot); 107 // Note: GetAt() halts if out-of-range even in release builds.
107 if (!pArray)
108 return 0;
109
110 if (nObjDefnID < 0 || nObjDefnID >= pArray->GetSize())
111 return 0;
112 CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID); 108 CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID);
113 v8::Local<v8::ObjectTemplate> objTemp = 109 v8::Local<v8::ObjectTemplate> objTemp =
114 v8::Local<v8::ObjectTemplate>::New(pIsolate, pObjDef->m_objTemplate); 110 v8::Local<v8::ObjectTemplate>::New(pIsolate, pObjDef->m_objTemplate);
115 objTemp->Set( 111 objTemp->Set(
116 v8::String::NewFromUtf8(pIsolate, bsMethodName.c_str(), 112 v8::String::NewFromUtf8(pIsolate, bsMethodName.c_str(),
117 v8::NewStringType::kNormal).ToLocalChecked(), 113 v8::NewStringType::kNormal).ToLocalChecked(),
118 v8::FunctionTemplate::New(pIsolate, pMethodCall), v8::ReadOnly); 114 v8::FunctionTemplate::New(pIsolate, pMethodCall), v8::ReadOnly);
119 pObjDef->m_objTemplate.Reset(pIsolate, objTemp); 115 pObjDef->m_objTemplate.Reset(pIsolate, objTemp);
120 return 0;
121 } 116 }
122 117
123 int JS_DefineObjProperty(v8::Isolate* pIsolate, 118 void JS_DefineObjProperty(v8::Isolate* pIsolate,
124 int nObjDefnID, 119 int nObjDefnID,
125 const wchar_t* sPropName, 120 const wchar_t* sPropName,
126 v8::AccessorGetterCallback pPropGet, 121 v8::AccessorGetterCallback pPropGet,
127 v8::AccessorSetterCallback pPropPut) { 122 v8::AccessorSetterCallback pPropPut) {
128 v8::Isolate::Scope isolate_scope(pIsolate); 123 v8::Isolate::Scope isolate_scope(pIsolate);
129 v8::HandleScope handle_scope(pIsolate); 124 v8::HandleScope handle_scope(pIsolate);
130 125
131 CFX_WideString ws = CFX_WideString(sPropName); 126 CFX_WideString ws = CFX_WideString(sPropName);
132 CFX_ByteString bsPropertyName = ws.UTF8Encode(); 127 CFX_ByteString bsPropertyName = ws.UTF8Encode();
128 CFX_PtrArray* pArray = (CFX_PtrArray*)pIsolate->GetData(g_embedderDataSlot);
133 129
134 CFX_PtrArray* pArray = (CFX_PtrArray*)pIsolate->GetData(g_embedderDataSlot); 130 // Note: GetAt() halts if out-of-range even in release builds.
135 if (!pArray)
136 return 0;
137
138 if (nObjDefnID < 0 || nObjDefnID >= pArray->GetSize())
139 return 0;
140 CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID); 131 CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID);
141 v8::Local<v8::ObjectTemplate> objTemp = 132 v8::Local<v8::ObjectTemplate> objTemp =
142 v8::Local<v8::ObjectTemplate>::New(pIsolate, pObjDef->m_objTemplate); 133 v8::Local<v8::ObjectTemplate>::New(pIsolate, pObjDef->m_objTemplate);
143 objTemp->SetAccessor( 134 objTemp->SetAccessor(
144 v8::String::NewFromUtf8(pIsolate, bsPropertyName.c_str(), 135 v8::String::NewFromUtf8(pIsolate, bsPropertyName.c_str(),
145 v8::NewStringType::kNormal).ToLocalChecked(), 136 v8::NewStringType::kNormal).ToLocalChecked(),
146 pPropGet, pPropPut); 137 pPropGet, pPropPut);
147 pObjDef->m_objTemplate.Reset(pIsolate, objTemp); 138 pObjDef->m_objTemplate.Reset(pIsolate, objTemp);
148 return 0;
149 } 139 }
150 140
151 int JS_DefineObjAllProperties(v8::Isolate* pIsolate, 141 void JS_DefineObjAllProperties(v8::Isolate* pIsolate,
152 int nObjDefnID, 142 int nObjDefnID,
153 v8::NamedPropertyQueryCallback pPropQurey, 143 v8::NamedPropertyQueryCallback pPropQurey,
154 v8::NamedPropertyGetterCallback pPropGet, 144 v8::NamedPropertyGetterCallback pPropGet,
155 v8::NamedPropertySetterCallback pPropPut, 145 v8::NamedPropertySetterCallback pPropPut,
156 v8::NamedPropertyDeleterCallback pPropDel) { 146 v8::NamedPropertyDeleterCallback pPropDel) {
157 v8::Isolate::Scope isolate_scope(pIsolate); 147 v8::Isolate::Scope isolate_scope(pIsolate);
158 v8::HandleScope handle_scope(pIsolate); 148 v8::HandleScope handle_scope(pIsolate);
149 CFX_PtrArray* pArray = (CFX_PtrArray*)pIsolate->GetData(g_embedderDataSlot);
159 150
160 CFX_PtrArray* pArray = (CFX_PtrArray*)pIsolate->GetData(g_embedderDataSlot); 151 // Note: GetAt() halts if out-of-range even in release builds.
161 if (!pArray)
162 return 0;
163
164 if (nObjDefnID < 0 || nObjDefnID >= pArray->GetSize())
165 return 0;
166 CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID); 152 CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID);
167 v8::Local<v8::ObjectTemplate> objTemp = 153 v8::Local<v8::ObjectTemplate> objTemp =
168 v8::Local<v8::ObjectTemplate>::New(pIsolate, pObjDef->m_objTemplate); 154 v8::Local<v8::ObjectTemplate>::New(pIsolate, pObjDef->m_objTemplate);
169 objTemp->SetNamedPropertyHandler(pPropGet, pPropPut, pPropQurey, pPropDel); 155 objTemp->SetNamedPropertyHandler(pPropGet, pPropPut, pPropQurey, pPropDel);
170 pObjDef->m_objTemplate.Reset(pIsolate, objTemp); 156 pObjDef->m_objTemplate.Reset(pIsolate, objTemp);
171 return 0;
172 } 157 }
173 158
174 int JS_DefineObjConst(v8::Isolate* pIsolate, 159 void JS_DefineObjConst(v8::Isolate* pIsolate,
175 int nObjDefnID, 160 int nObjDefnID,
176 const wchar_t* sConstName, 161 const wchar_t* sConstName,
177 v8::Local<v8::Value> pDefault) { 162 v8::Local<v8::Value> pDefault) {
178 v8::Isolate::Scope isolate_scope(pIsolate); 163 v8::Isolate::Scope isolate_scope(pIsolate);
179 v8::HandleScope handle_scope(pIsolate); 164 v8::HandleScope handle_scope(pIsolate);
180 165
181 CFX_PtrArray* pArray = (CFX_PtrArray*)pIsolate->GetData(g_embedderDataSlot);
182 if (!pArray)
183 return 0;
184
185 CFX_WideString ws = CFX_WideString(sConstName); 166 CFX_WideString ws = CFX_WideString(sConstName);
186 CFX_ByteString bsConstName = ws.UTF8Encode(); 167 CFX_ByteString bsConstName = ws.UTF8Encode();
168 CFX_PtrArray* pArray = (CFX_PtrArray*)pIsolate->GetData(g_embedderDataSlot);
187 169
188 if (nObjDefnID < 0 || nObjDefnID >= pArray->GetSize()) 170 // Note: GetAt() halts if out-of-range even in release builds.
189 return 0;
190 CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID); 171 CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(nObjDefnID);
191 v8::Local<v8::ObjectTemplate> objTemp = 172 v8::Local<v8::ObjectTemplate> objTemp =
192 v8::Local<v8::ObjectTemplate>::New(pIsolate, pObjDef->m_objTemplate); 173 v8::Local<v8::ObjectTemplate>::New(pIsolate, pObjDef->m_objTemplate);
193 objTemp->Set(pIsolate, bsConstName.c_str(), pDefault); 174 objTemp->Set(pIsolate, bsConstName.c_str(), pDefault);
194 pObjDef->m_objTemplate.Reset(pIsolate, objTemp); 175 pObjDef->m_objTemplate.Reset(pIsolate, objTemp);
195 return 0;
196 } 176 }
197 177
198 static v8::Global<v8::ObjectTemplate>& _getGlobalObjectTemplate( 178 static v8::Global<v8::ObjectTemplate>& _getGlobalObjectTemplate(
199 v8::Isolate* pIsolate) { 179 v8::Isolate* pIsolate) {
200 v8::Isolate::Scope isolate_scope(pIsolate); 180 v8::Isolate::Scope isolate_scope(pIsolate);
201 v8::HandleScope handle_scope(pIsolate); 181 v8::HandleScope handle_scope(pIsolate);
202 182
203 CFX_PtrArray* pArray = (CFX_PtrArray*)pIsolate->GetData(g_embedderDataSlot); 183 CFX_PtrArray* pArray = (CFX_PtrArray*)pIsolate->GetData(g_embedderDataSlot);
204 ASSERT(pArray != NULL); 184 ASSERT(pArray != NULL);
205 for (int i = 0; i < pArray->GetSize(); i++) { 185 for (int i = 0; i < pArray->GetSize(); i++) {
206 CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(i); 186 CJS_ObjDefintion* pObjDef = (CJS_ObjDefintion*)pArray->GetAt(i);
207 if (pObjDef->m_bSetAsGlobalObject) 187 if (pObjDef->m_bSetAsGlobalObject)
208 return pObjDef->m_objTemplate; 188 return pObjDef->m_objTemplate;
209 } 189 }
210 static v8::Global<v8::ObjectTemplate> gloabalObjectTemplate; 190 static v8::Global<v8::ObjectTemplate> gloabalObjectTemplate;
211 return gloabalObjectTemplate; 191 return gloabalObjectTemplate;
212 } 192 }
213 193
214 int JS_DefineGlobalMethod(v8::Isolate* pIsolate, 194 void JS_DefineGlobalMethod(v8::Isolate* pIsolate,
215 const wchar_t* sMethodName, 195 const wchar_t* sMethodName,
216 v8::FunctionCallback pMethodCall) { 196 v8::FunctionCallback pMethodCall) {
217 v8::Isolate::Scope isolate_scope(pIsolate); 197 v8::Isolate::Scope isolate_scope(pIsolate);
218 v8::HandleScope handle_scope(pIsolate); 198 v8::HandleScope handle_scope(pIsolate);
219 199
220 CFX_WideString ws = CFX_WideString(sMethodName); 200 CFX_WideString ws = CFX_WideString(sMethodName);
221 CFX_ByteString bsMethodName = ws.UTF8Encode(); 201 CFX_ByteString bsMethodName = ws.UTF8Encode();
222 202
223 v8::Local<v8::FunctionTemplate> funTempl = 203 v8::Local<v8::FunctionTemplate> funTempl =
224 v8::FunctionTemplate::New(pIsolate, pMethodCall); 204 v8::FunctionTemplate::New(pIsolate, pMethodCall);
225 v8::Local<v8::ObjectTemplate> objTemp; 205 v8::Local<v8::ObjectTemplate> objTemp;
226 206
227 v8::Global<v8::ObjectTemplate>& globalObjTemp = 207 v8::Global<v8::ObjectTemplate>& globalObjTemp =
228 _getGlobalObjectTemplate(pIsolate); 208 _getGlobalObjectTemplate(pIsolate);
229 if (globalObjTemp.IsEmpty()) 209 if (globalObjTemp.IsEmpty())
230 objTemp = v8::ObjectTemplate::New(pIsolate); 210 objTemp = v8::ObjectTemplate::New(pIsolate);
231 else 211 else
232 objTemp = v8::Local<v8::ObjectTemplate>::New(pIsolate, globalObjTemp); 212 objTemp = v8::Local<v8::ObjectTemplate>::New(pIsolate, globalObjTemp);
233 objTemp->Set( 213 objTemp->Set(
234 v8::String::NewFromUtf8(pIsolate, bsMethodName.c_str(), 214 v8::String::NewFromUtf8(pIsolate, bsMethodName.c_str(),
235 v8::NewStringType::kNormal).ToLocalChecked(), 215 v8::NewStringType::kNormal).ToLocalChecked(),
236 funTempl, v8::ReadOnly); 216 funTempl, v8::ReadOnly);
237 217
238 globalObjTemp.Reset(pIsolate, objTemp); 218 globalObjTemp.Reset(pIsolate, objTemp);
239
240 return 0;
241 } 219 }
242 220
243 int JS_DefineGlobalConst(v8::Isolate* pIsolate, 221 void JS_DefineGlobalConst(v8::Isolate* pIsolate,
244 const wchar_t* sConstName, 222 const wchar_t* sConstName,
245 v8::Local<v8::Value> pDefault) { 223 v8::Local<v8::Value> pDefault) {
246 v8::Isolate::Scope isolate_scope(pIsolate); 224 v8::Isolate::Scope isolate_scope(pIsolate);
247 v8::HandleScope handle_scope(pIsolate); 225 v8::HandleScope handle_scope(pIsolate);
248 226
249 CFX_WideString ws = CFX_WideString(sConstName); 227 CFX_WideString ws = CFX_WideString(sConstName);
250 CFX_ByteString bsConst = ws.UTF8Encode(); 228 CFX_ByteString bsConst = ws.UTF8Encode();
251 229
252 v8::Local<v8::ObjectTemplate> objTemp; 230 v8::Local<v8::ObjectTemplate> objTemp;
253 231
254 v8::Global<v8::ObjectTemplate>& globalObjTemp = 232 v8::Global<v8::ObjectTemplate>& globalObjTemp =
255 _getGlobalObjectTemplate(pIsolate); 233 _getGlobalObjectTemplate(pIsolate);
256 if (globalObjTemp.IsEmpty()) 234 if (globalObjTemp.IsEmpty())
257 objTemp = v8::ObjectTemplate::New(pIsolate); 235 objTemp = v8::ObjectTemplate::New(pIsolate);
258 else 236 else
259 objTemp = v8::Local<v8::ObjectTemplate>::New(pIsolate, globalObjTemp); 237 objTemp = v8::Local<v8::ObjectTemplate>::New(pIsolate, globalObjTemp);
260 objTemp->Set( 238 objTemp->Set(
261 v8::String::NewFromUtf8(pIsolate, bsConst.c_str(), 239 v8::String::NewFromUtf8(pIsolate, bsConst.c_str(),
262 v8::NewStringType::kNormal).ToLocalChecked(), 240 v8::NewStringType::kNormal).ToLocalChecked(),
263 pDefault, v8::ReadOnly); 241 pDefault, v8::ReadOnly);
264 242
265 globalObjTemp.Reset(pIsolate, objTemp); 243 globalObjTemp.Reset(pIsolate, objTemp);
266
267 return 0;
268 } 244 }
269 245
270 void JS_InitialRuntime(v8::Isolate* pIsolate, 246 void JS_InitialRuntime(v8::Isolate* pIsolate,
271 IFXJS_Runtime* pFXRuntime, 247 IFXJS_Runtime* pFXRuntime,
272 IFXJS_Context* context, 248 IFXJS_Context* context,
273 v8::Global<v8::Context>& v8PersistentContext) { 249 v8::Global<v8::Context>& v8PersistentContext) {
274 v8::Isolate::Scope isolate_scope(pIsolate); 250 v8::Isolate::Scope isolate_scope(pIsolate);
275 v8::Locker locker(pIsolate); 251 v8::Locker locker(pIsolate);
276 v8::HandleScope handle_scope(pIsolate); 252 v8::HandleScope handle_scope(pIsolate);
277 253
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 } 488 }
513 489
514 unsigned JS_CalcHash(const wchar_t* main) { 490 unsigned JS_CalcHash(const wchar_t* main) {
515 return (unsigned)FX_HashCode_String_GetW((const FX_WCHAR*)main, 491 return (unsigned)FX_HashCode_String_GetW((const FX_WCHAR*)main,
516 FXSYS_wcslen(main)); 492 FXSYS_wcslen(main));
517 } 493 }
518 const wchar_t* JS_GetTypeof(v8::Local<v8::Value> pObj) { 494 const wchar_t* JS_GetTypeof(v8::Local<v8::Value> pObj) {
519 if (pObj.IsEmpty()) 495 if (pObj.IsEmpty())
520 return NULL; 496 return NULL;
521 if (pObj->IsString()) 497 if (pObj->IsString())
522 return VALUE_NAME_STRING; 498 return kFXJSValueNameString;
523 if (pObj->IsNumber()) 499 if (pObj->IsNumber())
524 return VALUE_NAME_NUMBER; 500 return kFXJSValueNameNumber;
525 if (pObj->IsBoolean()) 501 if (pObj->IsBoolean())
526 return VALUE_NAME_BOOLEAN; 502 return kFXJSValueNameBoolean;
527 if (pObj->IsDate()) 503 if (pObj->IsDate())
528 return VALUE_NAME_DATE; 504 return kFXJSValueNameDate;
529 if (pObj->IsObject()) 505 if (pObj->IsObject())
530 return VALUE_NAME_OBJECT; 506 return kFXJSValueNameObject;
531 if (pObj->IsNull()) 507 if (pObj->IsNull())
532 return VALUE_NAME_NULL; 508 return kFXJSValueNameNull;
533 if (pObj->IsUndefined()) 509 if (pObj->IsUndefined())
534 return VALUE_NAME_UNDEFINED; 510 return kFXJSValueNameUndefined;
535 return NULL; 511 return NULL;
536 } 512 }
537 void JS_SetPrivate(v8::Local<v8::Object> pObj, void* p) { 513 void JS_SetPrivate(v8::Local<v8::Object> pObj, void* p) {
538 JS_SetPrivate(NULL, pObj, p); 514 JS_SetPrivate(NULL, pObj, p);
539 } 515 }
540 516
541 void* JS_GetPrivate(v8::Local<v8::Object> pObj) { 517 void* JS_GetPrivate(v8::Local<v8::Object> pObj) {
542 return JS_GetPrivate(NULL, pObj); 518 return JS_GetPrivate(NULL, pObj);
543 } 519 }
544 520
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
1119 1095
1120 bool JS_PortIsNan(double d) { 1096 bool JS_PortIsNan(double d) {
1121 return d != d; 1097 return d != d;
1122 } 1098 }
1123 1099
1124 double JS_LocalTime(double d) { 1100 double JS_LocalTime(double d) {
1125 return JS_GetDateTime() + _getDaylightSavingTA(d); 1101 return JS_GetDateTime() + _getDaylightSavingTA(d);
1126 } 1102 }
1127 1103
1128 // JavaScript time implement End. 1104 // JavaScript time implement End.
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/global.cpp ('k') | testing/resources/javascript/consts.in » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698