summaryrefslogtreecommitdiff
path: root/core/00_primordials.js
diff options
context:
space:
mode:
authorNayeem Rahman <nayeemrmn99@gmail.com>2023-06-25 08:35:31 +0100
committerGitHub <noreply@github.com>2023-06-25 09:35:31 +0200
commit28a4f3d0f5383695b1d49ccdc8b0f799a715b2c2 (patch)
treecd75b05db0bbfdadf3e565ca120d1f5d9ca39942 /core/00_primordials.js
parenta181ceb0e3791c842db6e8e6f528cf9ce320642a (diff)
Reland "refactor(core): cleanup feature flags for js source inclusion" (#19519)
Relands #19463. This time the `ExtensionFileSourceCode` enum is preserved, so this effectively just splits feature `include_js_for_snapshotting` into `exclude_js_sources` and `runtime_js_sources`, adds a `force_include_js_sources` option on `extension!()`, and unifies `ext::Init_ops_and_esm()` and `ext::init_ops()` into `ext::init()`.
Diffstat (limited to 'core/00_primordials.js')
-rw-r--r--core/00_primordials.js12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/00_primordials.js b/core/00_primordials.js
index 60474e649..998bfc7ab 100644
--- a/core/00_primordials.js
+++ b/core/00_primordials.js
@@ -34,6 +34,14 @@
"use strict";
(() => {
+ // Provide bootstrap namespace
+ globalThis.__bootstrap ??= {};
+ const key = Symbol.for("00_primordials.js");
+ if (globalThis.__bootstrap[key]) {
+ return;
+ }
+ globalThis.__bootstrap[key] = true;
+
const primordials = {};
const {
@@ -297,6 +305,7 @@
ArrayPrototypeJoin,
ArrayPrototypeMap,
FunctionPrototypeCall,
+ ObjectAssign,
ObjectDefineProperty,
ObjectFreeze,
ObjectPrototypeIsPrototypeOf,
@@ -610,6 +619,5 @@
ObjectSetPrototypeOf(primordials, null);
ObjectFreeze(primordials);
- // Provide bootstrap namespace
- globalThis.__bootstrap = { primordials };
+ ObjectAssign(globalThis.__bootstrap, { primordials });
})();