projects
/
platform
/
framework
/
web
/
wrtjs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4aa199d
)
[Service][UI] Expose functions and properties of global object
44/215244/3
author
Youngsoo Choi
<kenshin.choi@samsung.com>
Fri, 4 Oct 2019 04:53:08 +0000
(21:53 -0700)
committer
Youngsoo Choi
<kenshin.choi@samsung.com>
Fri, 4 Oct 2019 05:27:39 +0000
(22:27 -0700)
This enables functions and properties of global object,
such as setInterval, setTimeout, and etc in ui service apps.
Change-Id: Iebf68a53fc1e0f59e71c03f6ed38eae0d17a138a
Signed-off-by: Youngsoo Choi <kenshin.choi@samsung.com>
wrt_app/src/runtime.js
patch
|
blob
|
history
diff --git
a/wrt_app/src/runtime.js
b/wrt_app/src/runtime.js
index
58d3a71
..
7876a81
100755
(executable)
--- a/
wrt_app/src/runtime.js
+++ b/
wrt_app/src/runtime.js
@@
-190,6
+190,9
@@
class Runtime {
module: new Module,
require: require,
};
+ for(let key in global) {
+ _this.sandbox[app_id][key] = global[key];
+ }
let options = {};
let code = fs.readFileSync(params[1]);
vm.runInNewContext(code, _this.sandbox[app_id], options);