diff options
-rw-r--r-- | src/bun.js/bindings/bindings.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/bun.js/bindings/bindings.cpp b/src/bun.js/bindings/bindings.cpp index 4c65cedf5..f6cb879bf 100644 --- a/src/bun.js/bindings/bindings.cpp +++ b/src/bun.js/bindings/bindings.cpp @@ -3755,6 +3755,8 @@ void JSC__JSValue__forEachProperty(JSC__JSValue JSValue0, JSC__JSGlobalObject* g } } + auto* clientData = WebCore::clientData(vm); + if (fast) { bool anyHits = false; @@ -3769,11 +3771,13 @@ void JSC__JSValue__forEachProperty(JSC__JSValue JSValue0, JSC__JSGlobalObject* g } // ignore constructor - if (entry.key() == vm.propertyNames->constructor) { + if (entry.key() == vm.propertyNames->constructor) return true; - } } + if (clientData->builtinNames().bunNativePtrPrivateName() == entry.key()) + return true; + ZigString key = toZigString(entry.key()); JSC::JSValue propertyValue = object->getDirect(entry.offset()); @@ -3815,13 +3819,12 @@ void JSC__JSValue__forEachProperty(JSC__JSValue JSValue0, JSC__JSGlobalObject* g RETURN_IF_EXCEPTION(scope, void()); for (auto& property : properties) { - if (UNLIKELY(property.isEmpty() || property.isNull())) + if (UNLIKELY(property.isEmpty() || property.isNull() || property.isPrivateName())) continue; // ignore constructor - if (property == vm.propertyNames->constructor) { + if (property == vm.propertyNames->constructor || clientData->builtinNames().bunNativePtrPrivateName() == property) continue; - } JSC::PropertySlot slot(object, PropertySlot::InternalMethodType::Get); if (!object->getPropertySlot(globalObject, property, slot)) |