summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBradley Farias <bradley.meck@gmail.com>2021-02-09 13:21:18 -0600
committerBradley Farias <bradley.meck@gmail.com>2021-02-09 13:21:18 -0600
commit31fbfc80728c2e786506004480029ce4153533a6 (patch)
tree2fff17d3f9d77bbba6f47592aecb2739bd9dd6e1
parent22c442f833754f1c3802477c041d1d71feaf16c3 (diff)
downloadnode-new-policy-scope-fix.tar.gz
-rw-r--r--lib/internal/policy/manifest.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/internal/policy/manifest.js b/lib/internal/policy/manifest.js
index d22847d987..62d4746a47 100644
--- a/lib/internal/policy/manifest.js
+++ b/lib/internal/policy/manifest.js
@@ -41,6 +41,8 @@ const shouldAbortOnUncaughtException =
getOptionValue('--abort-on-uncaught-exception');
const { abort, exit, _rawDebug } = process;
+const TERMINATE = () => null;
+
// From https://url.spec.whatwg.org/#special-scheme
const SPECIAL_SCHEMES = new SafeSet([
'file:',
@@ -139,6 +141,8 @@ class Manifest {
*/
constructor(obj, manifestURL) {
const scopes = this.#scopeDependencies;
+ scopes.set(null, TERMINATE);
+ scopes.set(undefined, TERMINATE);
const integrities = this.#resourceIntegrities;
const dependencies = this.#resourceDependencies;
let reaction = REACTION_THROW;