aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/bindings.cpp
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-05-18 18:45:13 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-05-18 18:45:13 -0700
commitf862ae405036acb35ed2134b66f056031e1367fe (patch)
tree65c103ba17015b4f9927f417d66ca95f688a6ef9 /src/bun.js/bindings/bindings.cpp
parent958f5f8b9998a0e5140f7275946750e76f02bd73 (diff)
downloadbun-f862ae405036acb35ed2134b66f056031e1367fe.tar.gz
bun-f862ae405036acb35ed2134b66f056031e1367fe.tar.zst
bun-f862ae405036acb35ed2134b66f056031e1367fe.zip
[node:vm] Propagate global properties defined on the new context object
Diffstat (limited to 'src/bun.js/bindings/bindings.cpp')
-rw-r--r--src/bun.js/bindings/bindings.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bun.js/bindings/bindings.cpp b/src/bun.js/bindings/bindings.cpp
index b0078503b..c9411c78f 100644
--- a/src/bun.js/bindings/bindings.cpp
+++ b/src/bun.js/bindings/bindings.cpp
@@ -3760,7 +3760,7 @@ restart:
if (prototypeCount++ < 5) {
if (JSValue proto = prototypeObject.getPrototype(globalObject)) {
- if (!(proto == globalObject->objectPrototype() || proto == globalObject->functionPrototype())) {
+ if (!(proto == globalObject->objectPrototype() || proto == globalObject->functionPrototype() || (proto.inherits<JSGlobalProxy>() && jsCast<JSGlobalProxy*>(proto)->target() != globalObject))) {
if ((structure = proto.structureOrNull())) {
prototypeObject = proto;
fast = canPerformFastPropertyEnumerationForIterationBun(structure);
@@ -3779,7 +3779,7 @@ restart:
JSObject* iterating = prototypeObject.getObject();
- while (iterating && !(iterating == globalObject->objectPrototype() || iterating == globalObject->functionPrototype()) && prototypeCount++ < 5) {
+ while (iterating && !(iterating == globalObject->objectPrototype() || iterating == globalObject->functionPrototype() || (iterating->inherits<JSGlobalProxy>() && jsCast<JSGlobalProxy*>(iterating)->target() != globalObject)) && prototypeCount++ < 5) {
iterating->methodTable()->getOwnPropertyNames(iterating, globalObject, properties, DontEnumPropertiesMode::Include);
RETURN_IF_EXCEPTION(scope, void());
for (auto& property : properties) {