mirror of https://github.com/nodejs/node.git
vm: freeze `dependencySpecifiers` array
PR-URL: https://github.com/nodejs/node/pull/49720 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
This commit is contained in:
parent
54bb691c0b
commit
4038cf0513
|
@ -7,6 +7,7 @@ const {
|
|||
ArrayPrototypeIndexOf,
|
||||
ArrayPrototypeSome,
|
||||
ObjectDefineProperty,
|
||||
ObjectFreeze,
|
||||
ObjectGetPrototypeOf,
|
||||
ObjectSetPrototypeOf,
|
||||
ReflectApply,
|
||||
|
@ -340,9 +341,7 @@ class SourceTextModule extends Module {
|
|||
if (this[kWrap] === undefined) {
|
||||
throw new ERR_VM_MODULE_NOT_MODULE();
|
||||
}
|
||||
if (this[kDependencySpecifiers] === undefined) {
|
||||
this[kDependencySpecifiers] = this[kWrap].getStaticDependencySpecifiers();
|
||||
}
|
||||
this[kDependencySpecifiers] ??= ObjectFreeze(this[kWrap].getStaticDependencySpecifiers());
|
||||
return this[kDependencySpecifiers];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue