Merge "[Service][UI] Expose primitives and standard objects" into tizen_5.5
[platform/framework/web/wrtjs.git] / wrt_app / src / runtime.js
index b097972..bb98db3 100644 (file)
@@ -218,6 +218,19 @@ class Runtime {
                     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);