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

Side by Side Diff: fpdfsdk/src/javascript/global.cpp

Issue 1342433002: Fix strings, remove stringify macros, void return types for Consts.h (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Added tests 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/JS_Runtime.cpp ('k') | fpdfsdk/src/jsapi/fxjs_v8.cpp » ('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 "../../include/javascript/IJavaScript.h" 7 #include "../../include/javascript/IJavaScript.h"
8 #include "../../include/javascript/JS_Context.h" 8 #include "../../include/javascript/JS_Context.h"
9 #include "../../include/javascript/JS_Define.h" 9 #include "../../include/javascript/JS_Define.h"
10 #include "../../include/javascript/JS_EventHandler.h" 10 #include "../../include/javascript/JS_EventHandler.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 CHash<'u', 'n', 'd', 'e', 'f', 'i', 'n', 'e', 'd'>::value; 53 CHash<'u', 'n', 'd', 'e', 'f', 'i', 'n', 'e', 'd'>::value;
54 54
55 #ifdef _DEBUG 55 #ifdef _DEBUG
56 class HashVerify { 56 class HashVerify {
57 public: 57 public:
58 HashVerify(); 58 HashVerify();
59 } g_hashVerify; 59 } g_hashVerify;
60 60
61 HashVerify::HashVerify() { 61 HashVerify::HashVerify() {
62 ASSERT(JSCONST_nStringHash == 62 ASSERT(JSCONST_nStringHash ==
63 JS_CalcHash(VALUE_NAME_STRING, wcslen(VALUE_NAME_STRING))); 63 JS_CalcHash(kFXJSValueNameString, wcslen(kFXJSValueNameString)));
64 ASSERT(JSCONST_nNumberHash == 64 ASSERT(JSCONST_nNumberHash ==
65 JS_CalcHash(VALUE_NAME_NUMBER, wcslen(VALUE_NAME_NUMBER))); 65 JS_CalcHash(kFXJSValueNameNumber, wcslen(kFXJSValueNameNumber)));
66 ASSERT(JSCONST_nBoolHash == 66 ASSERT(JSCONST_nBoolHash ==
67 JS_CalcHash(VALUE_NAME_BOOLEAN, wcslen(VALUE_NAME_BOOLEAN))); 67 JS_CalcHash(kFXJSValueNameBoolean, wcslen(kFXJSValueNameBoolean)));
68 ASSERT(JSCONST_nDateHash == 68 ASSERT(JSCONST_nDateHash ==
69 JS_CalcHash(VALUE_NAME_DATE, wcslen(VALUE_NAME_DATE))); 69 JS_CalcHash(kFXJSValueNameDate, wcslen(kFXJSValueNameDate)));
70 ASSERT(JSCONST_nObjectHash == 70 ASSERT(JSCONST_nObjectHash ==
71 JS_CalcHash(VALUE_NAME_OBJECT, wcslen(VALUE_NAME_OBJECT))); 71 JS_CalcHash(kFXJSValueNameObject, wcslen(kFXJSValueNameObject)));
72 ASSERT(JSCONST_nFXobjHash == 72 ASSERT(JSCONST_nFXobjHash ==
73 JS_CalcHash(VALUE_NAME_FXOBJ, wcslen(VALUE_NAME_FXOBJ))); 73 JS_CalcHash(kFXJSValueNameFxobj, wcslen(kFXJSValueNameFxobj)));
74 ASSERT(JSCONST_nNullHash == 74 ASSERT(JSCONST_nNullHash ==
75 JS_CalcHash(VALUE_NAME_NULL, wcslen(VALUE_NAME_NULL))); 75 JS_CalcHash(kFXJSValueNameNull, wcslen(kFXJSValueNameNull)));
76 ASSERT(JSCONST_nUndefHash == 76 ASSERT(JSCONST_nUndefHash ==
77 JS_CalcHash(VALUE_NAME_UNDEFINED, wcslen(VALUE_NAME_UNDEFINED))); 77 JS_CalcHash(kFXJSValueNameUndefined, wcslen(kFXJSValueNameUndefined)));
78 } 78 }
79 #endif 79 #endif
80 80
81 BEGIN_JS_STATIC_CONST(CJS_Global) 81 BEGIN_JS_STATIC_CONST(CJS_Global)
82 END_JS_STATIC_CONST() 82 END_JS_STATIC_CONST()
83 83
84 BEGIN_JS_STATIC_PROP(CJS_Global) 84 BEGIN_JS_STATIC_PROP(CJS_Global)
85 END_JS_STATIC_PROP() 85 END_JS_STATIC_PROP()
86 86
87 BEGIN_JS_STATIC_METHOD(CJS_Global) 87 BEGIN_JS_STATIC_METHOD(CJS_Global)
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
535 return VT_boolean; 535 return VT_boolean;
536 if (nHash == JSCONST_nDateHash) 536 if (nHash == JSCONST_nDateHash)
537 return VT_date; 537 return VT_date;
538 if (nHash == JSCONST_nObjectHash) 538 if (nHash == JSCONST_nObjectHash)
539 return VT_object; 539 return VT_object;
540 if (nHash == JSCONST_nFXobjHash) 540 if (nHash == JSCONST_nFXobjHash)
541 return VT_fxobject; 541 return VT_fxobject;
542 542
543 return VT_unknown; 543 return VT_unknown;
544 } 544 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/javascript/JS_Runtime.cpp ('k') | fpdfsdk/src/jsapi/fxjs_v8.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698