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 "xfa/fxjse/context.h" | 7 #include "xfa/fxjse/context.h" |
8 | 8 |
9 #include "xfa/fxjse/class.h" | 9 #include "xfa/fxjse/class.h" |
10 #include "xfa/fxjse/scope_inline.h" | 10 #include "xfa/fxjse/scope_inline.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 " return globalobj.prototype[name].apply(obj, " | 63 " return globalobj.prototype[name].apply(obj, " |
64 " Array.prototype.slice.call(arguments, 1));\n" | 64 " Array.prototype.slice.call(arguments, 1));\n" |
65 " })\n" | 65 " })\n" |
66 " });\n" | 66 " });\n" |
67 " }\n" | 67 " }\n" |
68 " });\n" | 68 " });\n" |
69 " }\n" | 69 " }\n" |
70 " }\n" | 70 " }\n" |
71 "}(this, {String: ['substr', 'toUpperCase']}));"}; | 71 "}(this, {String: ['substr', 'toUpperCase']}));"}; |
72 void FXJSE_Context_EnableCompatibleMode(FXJSE_HCONTEXT hContext, | 72 void FXJSE_Context_EnableCompatibleMode(FXJSE_HCONTEXT hContext, |
73 FX_DWORD dwCompatibleFlags) { | 73 uint32_t dwCompatibleFlags) { |
74 for (uint32_t i = 0; i < (uint32_t)FXJSE_COMPATIBLEMODEFLAGCOUNT; i++) { | 74 for (uint32_t i = 0; i < (uint32_t)FXJSE_COMPATIBLEMODEFLAGCOUNT; i++) { |
75 if (dwCompatibleFlags & (1 << i)) { | 75 if (dwCompatibleFlags & (1 << i)) { |
76 FXJSE_ExecuteScript(hContext, szCompatibleModeScripts[i], NULL, NULL); | 76 FXJSE_ExecuteScript(hContext, szCompatibleModeScripts[i], NULL, NULL); |
77 } | 77 } |
78 } | 78 } |
79 } | 79 } |
80 | 80 |
81 FX_BOOL FXJSE_ExecuteScript(FXJSE_HCONTEXT hContext, | 81 FX_BOOL FXJSE_ExecuteScript(FXJSE_HCONTEXT hContext, |
82 const FX_CHAR* szScript, | 82 const FX_CHAR* szScript, |
83 FXJSE_HVALUE hRetValue, | 83 FXJSE_HVALUE hRetValue, |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 return TRUE; | 266 return TRUE; |
267 } | 267 } |
268 } | 268 } |
269 if (lpRetValue) { | 269 if (lpRetValue) { |
270 lpRetValue->m_hValue.Reset(m_pIsolate, | 270 lpRetValue->m_hValue.Reset(m_pIsolate, |
271 FXJSE_CreateReturnValue(m_pIsolate, trycatch)); | 271 FXJSE_CreateReturnValue(m_pIsolate, trycatch)); |
272 } | 272 } |
273 return FALSE; | 273 return FALSE; |
274 } | 274 } |
275 } | 275 } |
OLD | NEW |