| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent fe6c419 commit 0d810b7
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -180,8 +180,7 @@ if (config.hasInspector) { | |||
| 180 | 180 | internalBinding('inspector').registerAsyncHook(enable, disable); | |
| 181 | 181 | } | |
| 182 | 182 | ||
| 183 | - const browserGlobals = !process._noBrowserGlobals; | ||
| 184 | - if (browserGlobals) { | ||
| 183 | + if (!config.noBrowserGlobals) { | ||
| 185 | 184 | // Override global console from the one provided by the VM | |
| 186 | 185 | // to the one implemented by Node.js | |
| 187 | 186 | // https://console.spec.whatwg.org/#console-namespace | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -135,6 +135,20 @@ function initializeDeprecations() { | |||
| 135 | 135 | 'DEP0103') : | |
| 136 | 136 | types[name]; | |
| 137 | 137 | } | |
| 138 | + | ||
| 139 | + // TODO(joyeecheung): this is a legacy property exposed to process. | ||
| 140 | + // Now that we use the config binding to carry this information, remove | ||
| 141 | + // it from the process. We may consider exposing it properly in | ||
| 142 | + // process.features. | ||
| 143 | + const { noBrowserGlobals } = internalBinding('config'); | ||
| 144 | + if (noBrowserGlobals) { | ||
| 145 | + Object.defineProperty(process, '_noBrowserGlobals', { | ||
| 146 | + writable: false, | ||
| 147 | + enumerable: true, | ||
| 148 | + configurable: true, | ||
| 149 | + value: noBrowserGlobals | ||
| 150 | + }); | ||
| 151 | + } | ||
| 138 | 152 | } | |
| 139 | 153 | ||
| 140 | 154 | function setupChildProcessIpcChannel() { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -70,6 +70,13 @@ static void Initialize(Local<Object> target, | |||
| 70 | 70 | READONLY_FALSE_PROPERTY(target, "hasInspector"); | |
| 71 | 71 | #endif | |
| 72 | 72 | ||
| 73 | + // configure --no-browser-globals | ||
| 74 | + #ifdef NODE_NO_BROWSER_GLOBALS | ||
| 75 | + READONLY_TRUE_PROPERTY(target, "noBrowserGlobals"); | ||
| 76 | + #else | ||
| 77 | + READONLY_FALSE_PROPERTY(target, "noBrowserGlobals"); | ||
| 78 | + #endif // NODE_NO_BROWSER_GLOBALS | ||
| 79 | + | ||
| 73 | 80 | READONLY_PROPERTY(target, | |
| 74 | 81 | "bits", | |
| 75 | 82 | Number::New(env->isolate(), 8 * sizeof(intptr_t))); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -233,11 +233,6 @@ MaybeLocal<Object> CreateProcessObject( | |||
| 233 | 233 | READONLY_PROPERTY(process, "throwDeprecation", True(env->isolate())); | |
| 234 | 234 | } | |
| 235 | 235 | ||
| 236 | - #ifdef NODE_NO_BROWSER_GLOBALS | ||
| 237 | - // configure --no-browser-globals | ||
| 238 | - READONLY_PROPERTY(process, "_noBrowserGlobals", True(env->isolate())); | ||
| 239 | - #endif // NODE_NO_BROWSER_GLOBALS | ||
| 240 | - | ||
| 241 | 236 | // --prof-process | |
| 242 | 237 | // TODO(addaleax): Remove this. | |
| 243 | 238 | if (env->options()->prof_process) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments