Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fixup! src: add fetch to bootstrap/browser.js
  • Loading branch information
RaisinTen committed Feb 13, 2022
commit 6f380006dbbba6c65ef0061086dd97c40170ee67
22 changes: 0 additions & 22 deletions lib/internal/bootstrap/pre_execution.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,6 @@ const {
getEmbedderOptions,
} = require('internal/options');
const { reconnectZeroFillToggle } = require('internal/buffer');
const {
defineOperation,
emitExperimentalWarning,
exposeInterface,
} = require('internal/util');

const { Buffer } = require('buffer');
const { ERR_MANIFEST_ASSERT_INTEGRITY } = require('internal/errors').codes;
Expand All @@ -35,7 +30,6 @@ function prepareMainThreadExecution(expandArgv1 = false) {
setupPerfHooks();
setupInspectorHooks();
setupWarningHandler();
setupFetch();

// Resolve the coverage directory to an absolute path, and
// overwrite process.env so that the original path gets passed
Expand Down Expand Up @@ -147,21 +141,6 @@ function setupWarningHandler() {
}
}

// https://fetch.spec.whatwg.org/
function setupFetch() {
if (!getOptionValue('--experimental-fetch')) {
return;
}

emitExperimentalWarning('Fetch');

const undici = require('internal/deps/undici/undici');
defineOperation(globalThis, 'fetch', undici.fetch);
exposeInterface(globalThis, 'Headers', undici.Headers);
exposeInterface(globalThis, 'Request', undici.Request);
exposeInterface(globalThis, 'Response', undici.Response);
}

// Setup User-facing NODE_V8_COVERAGE environment variable that writes
// ScriptCoverage to a specified file.
function setupCoverageHooks(dir) {
Expand Down Expand Up @@ -502,7 +481,6 @@ module.exports = {
patchProcessObject,
setupCoverageHooks,
setupWarningHandler,
setupFetch,
setupDebugEnv,
setupPerfHooks,
prepareMainThreadExecution,
Expand Down
2 changes: 0 additions & 2 deletions lib/internal/main/worker_thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const {
setupCoverageHooks,
setupInspectorHooks,
setupWarningHandler,
setupFetch,
setupDebugEnv,
setupPerfHooks,
initializeDeprecations,
Expand Down Expand Up @@ -68,7 +67,6 @@ setupInspectorHooks();
setupDebugEnv();

setupWarningHandler();
setupFetch();
initializeSourceMapsHandlers();

// Since worker threads cannot switch cwd, we do not need to
Expand Down
3 changes: 2 additions & 1 deletion src/node_options.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1199,4 +1199,5 @@ std::vector<std::string> ParseNodeOptionsEnvVar(
} // namespace node

NODE_MODULE_CONTEXT_AWARE_INTERNAL(options, node::options_parser::Initialize)
NODE_MODULE_EXTERNAL_REFERENCE(options, node::options_parser::RegisterExternalReferences)
NODE_MODULE_EXTERNAL_REFERENCE(options,
node::options_parser::RegisterExternalReferences)