Merge "[Service][UI] Expose primitives and standard objects" into tizen_5.5 accepted/tizen/5.5/unified/20191120.034626 submit/tizen_5.5/20191113.071758 submit/tizen_5.5/20191114.074818 submit/tizen_5.5/20191115.025402 submit/tizen_5.5/20191118.004004
authorjaekuk lee <juku1999@samsung.com>
Wed, 13 Nov 2019 04:44:49 +0000 (04:44 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Wed, 13 Nov 2019 04:44:49 +0000 (04:44 +0000)
1  2 
wrt_app/src/runtime.js

diff --combined wrt_app/src/runtime.js
@@@ -21,7 -21,6 +21,7 @@@ const AddonManager = require('./addon_m
  const {app, ipcMain} = require('electron');
  const IPC_MESSAGE = require('./ipc_message');
  const TimerManager = require('../service/timer_manager');
 +const TizenExtension = require('../service/tizen_extension');
  const WAS_EVENT = require('./was_event');
  const WebApplication = require('./web_application');
  
@@@ -208,7 -207,6 +208,7 @@@ class Runtime 
                          console: console,
                          module: new Module,
                          require: require,
 +                        tizen: tizen,
                      };
                      for(let key in global) {
                          _this.sandbox[app_id][key] = global[key];
                      for(let key in timer_api) {
                          _this.sandbox[app_id][key] = timer_api[key];
                      }
+                     let standard_object_list = [ Error, EvalError, RangeError, ReferenceError,
+                             SyntaxError, TypeError, URIError, Number, BigInt, Math, Date,
+                             String, RegExp, Array, Int8Array, Uint8Array, Uint8ClampedArray,
+                             Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array,
+                             Float64Array, BigInt64Array, BigUint64Array, Map, Set, WeakMap,
+                             WeakSet, ArrayBuffer, DataView, JSON, Promise, Reflect, Proxy,
+                             Intl, Intl.Collator, Intl.DateTimeFormat, Intl.NumberFormat, Intl.PluralRules,
+                             WebAssembly, WebAssembly.Module, WebAssembly.Instance, WebAssembly.Memory,
+                             WebAssembly.Table, WebAssembly.CompileError, WebAssembly.LinkError,
+                             WebAssembly.RuntimeError, Boolean, Function, Object, Symbol ];
+                     for (let idx in standard_object_list) {
+                         _this.sandbox[app_id][standard_object_list[idx].name] = standard_object_list[idx];
+                     }
                      let options = {};
                      let code = fs.readFileSync(params[1]);
                      vm.runInNewContext(code, _this.sandbox[app_id], options);