We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
dependencySpecifiers
1 parent 8399e87 commit 1dedee6Copy full SHA for 1dedee6
lib/internal/vm/module.js
@@ -7,6 +7,7 @@ const {
7
ArrayPrototypeIndexOf,
8
ArrayPrototypeSome,
9
ObjectDefineProperty,
10
+ ObjectFreeze,
11
ObjectGetPrototypeOf,
12
ObjectSetPrototypeOf,
13
ReflectApply,
@@ -340,9 +341,7 @@ class SourceTextModule extends Module {
340
341
if (this[kWrap] === undefined) {
342
throw new ERR_VM_MODULE_NOT_MODULE();
343
}
- if (this[kDependencySpecifiers] === undefined) {
344
- this[kDependencySpecifiers] = this[kWrap].getStaticDependencySpecifiers();
345
- }
+ this[kDependencySpecifiers] ??= ObjectFreeze(this[kWrap].getStaticDependencySpecifiers());
346
return this[kDependencySpecifiers];
347
348
0 commit comments