| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8e8768e commit 2fa959b
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -373,6 +373,12 @@ parser.add_option('--enable-static', | |||
| 373 | 373 | dest='enable_static', | |
| 374 | 374 | help='build as static library') | |
| 375 | 375 | ||
| 376 | + parser.add_option('--no-browser-globals', | ||
| 377 | + action='store_true', | ||
| 378 | + dest='no_browser_globals', | ||
| 379 | + help='do not export browser globals like setTimeout, console, etc. ' + | ||
| 380 | + '(This mode is not officially supported for regular applications)') | ||
| 381 | + | ||
| 376 | 382 | (options, args) = parser.parse_args() | |
| 377 | 383 | ||
| 378 | 384 | # Expand ~ in the install prefix now, it gets written to multiple files. | |
@@ -765,6 +771,8 @@ def configure_node(o): | |||
| 765 | 771 | if options.enable_static: | |
| 766 | 772 | o['variables']['node_target_type'] = 'static_library' | |
| 767 | 773 | ||
| 774 | + o['variables']['node_no_browser_globals'] = b(options.no_browser_globals) | ||
| 775 | + | ||
| 768 | 776 | if options.linked_module: | |
| 769 | 777 | o['variables']['library_files'] = options.linked_module | |
| 770 | 778 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,8 +30,10 @@ | |||
| 30 | 30 | setupProcessFatal(); | |
| 31 | 31 | ||
| 32 | 32 | setupGlobalVariables(); | |
| 33 | - setupGlobalTimeouts(); | ||
| 34 | - setupGlobalConsole(); | ||
| 33 | + if (!process._noBrowserGlobals) { | ||
| 34 | + setupGlobalTimeouts(); | ||
| 35 | + setupGlobalConsole(); | ||
| 36 | + } | ||
| 35 | 37 | ||
| 36 | 38 | const _process = NativeModule.require('internal/process'); | |
| 37 | 39 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,6 +5,7 @@ | |||
| 5 | 5 | 'node_use_lttng%': 'false', | |
| 6 | 6 | 'node_use_etw%': 'false', | |
| 7 | 7 | 'node_use_perfctr%': 'false', | |
| 8 | + 'node_no_browser_globals%': 'false', | ||
| 8 | 9 | 'node_has_winsdk%': 'false', | |
| 9 | 10 | 'node_shared_zlib%': 'false', | |
| 10 | 11 | 'node_shared_http_parser%': 'false', | |
@@ -366,6 +367,9 @@ | |||
| 366 | 367 | 'tools/msvs/genfiles/node_perfctr_provider.rc', | |
| 367 | 368 | ] | |
| 368 | 369 | } ], | |
| 370 | + [ 'node_no_browser_globals=="true"', { | ||
| 371 | + 'defines': [ 'NODE_NO_BROWSER_GLOBALS' ], | ||
| 372 | + } ], | ||
| 369 | 373 | [ 'v8_postmortem_support=="true"', { | |
| 370 | 374 | 'dependencies': [ 'deps/v8/tools/gyp/v8.gyp:postmortem-metadata' ], | |
| 371 | 375 | 'conditions': [ | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3059,6 +3059,11 @@ void SetupProcessObject(Environment* env, | |||
| 3059 | 3059 | READONLY_PROPERTY(process, "throwDeprecation", True(env->isolate())); | |
| 3060 | 3060 | } | |
| 3061 | 3061 | ||
| 3062 | + #ifdef NODE_NO_BROWSER_GLOBALS | ||
| 3063 | + // configure --no-browser-globals | ||
| 3064 | + READONLY_PROPERTY(process, "_noBrowserGlobals", True(env->isolate())); | ||
| 3065 | + #endif // NODE_NO_BROWSER_GLOBALS | ||
| 3066 | + | ||
| 3062 | 3067 | // --prof-process | |
| 3063 | 3068 | if (prof_process) { | |
| 3064 | 3069 | READONLY_PROPERTY(process, "profProcess", True(env->isolate())); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments