summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFedor Indutny <fedor@indutny.com>2016-03-22 21:05:54 -0400
committerFedor Indutny <fedor@indutny.com>2016-03-25 21:02:18 -0400
commit8363ede8551b7c30293901f79ea8204680bc9757 (patch)
treeac3493855b1f6c03f7eb339d0f1e04bf3d012a87 /lib
parent53a95a5b12fbbfc8d465689e43aa77da32e5d0f3 (diff)
downloadandroid-node-v8-8363ede8551b7c30293901f79ea8204680bc9757.tar.gz
android-node-v8-8363ede8551b7c30293901f79ea8204680bc9757.tar.bz2
android-node-v8-8363ede8551b7c30293901f79ea8204680bc9757.zip
node: --no-browser-globals configure flag
Introduce `--no-browser-globals` configure flag. With this flag set, following globals won't be exported: - `setTimeout`, `clearTimeout`, `setInterval`, `clearInterval`, `setImmediate`, `clearImmediate` - `console` These are provided by the DOM implementation in browser, so the `--no-browser-globals` flag may be helpful when embedding node.js within chromium/webkit. Inspired-By: https://github.com/atom/node/commit/82e10ce94f3c90234dac187f04a47d4d357ffd31 PR-URL: https://github.com/nodejs/node/pull/5853 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Rod Vagg <rod@vagg.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/internal/bootstrap_node.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js
index e4fd8d7dec..21f7120677 100644
--- a/lib/internal/bootstrap_node.js
+++ b/lib/internal/bootstrap_node.js
@@ -40,8 +40,10 @@
setupProcessFatal();
setupGlobalVariables();
- setupGlobalTimeouts();
- setupGlobalConsole();
+ if (!process._noBrowserGlobals) {
+ setupGlobalTimeouts();
+ setupGlobalConsole();
+ }
const _process = NativeModule.require('internal/process');