Chromium Code Reviews| Index: xfa/src/fxjse/src/context.cpp |
| diff --git a/xfa/src/fxjse/src/context.cpp b/xfa/src/fxjse/src/context.cpp |
| index 269e817cd622b62fdd5aac2e192ee2dc0b8c54e9..b831af55631347a4c1c281f11529aac6583f2d0f 100644 |
| --- a/xfa/src/fxjse/src/context.cpp |
| +++ b/xfa/src/fxjse/src/context.cpp |
| @@ -41,13 +41,13 @@ FXJSE_HRUNTIME FXJSE_Context_GetRuntime(FXJSE_HCONTEXT hContext) { |
| } |
| static const FX_CHAR* szCompatibleModeScripts[] = { |
| "(function (global, list) { 'use strict'; var objname; for (objname in list) { var globalobj = global[objname];\n\ |
|
Tom Sepez
2016/02/23 17:44:19
can we make this less of a mess? Use concatenation
dsinclair
2016/02/23 19:14:01
Yes, but it's still horrible.
|
| - if (globalobj) { list[objname].forEach( function (name) { if (!globalobj[name]) { Object.defineProperty(globalobj, name, {writable: true, enumerable: false, value: \n\ |
| - (function (obj) {\n\ |
| - if (arguments.length === 0) {\n\ |
| - throw new TypeError('missing argument 0 when calling function ' + objname + '.' + name);\n\ |
| - }\n\ |
| - return globalobj.prototype[name].apply(obj, Array.prototype.slice.call(arguments, 1));\n\ |
| -})});}});}}}(this, {String: ['substr', 'toUpperCase']}));", |
| + if (globalobj) { list[objname].forEach( function (name) { if (!globalobj[name]) { Object.defineProperty(globalobj, name, {writable: true, enumerable: false, value: \n\ |
| + (function(obj) {\n\ |
| + if (arguments.length === 0) {\n\ |
| + throw new TypeError('missing argument 0 when calling function ' + objname + '.' + name);\n\ |
| + }\n\ |
| + return globalobj.prototype[name].apply(obj, Array.prototype.slice.call(arguments, 1));\n\ |
| + })}); }}); }}}(this, {String: ['substr', 'toUpperCase']})); ", |
| }; |
| void FXJSE_Context_EnableCompatibleMode(FXJSE_HCONTEXT hContext, |
| FX_DWORD dwCompatibleFlags) { |