aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-27 07:58:10 -0800
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-11-27 07:58:10 -0800
commit706406af48aa43e218d9428761acfd1b64ec5be4 (patch)
treee4409a40caefe7348ba1e1da779972f4ed6fcf33 /src
parent39493e5d944bd627f79889be85a131cc349238db (diff)
downloadbun-706406af48aa43e218d9428761acfd1b64ec5be4.tar.gz
bun-706406af48aa43e218d9428761acfd1b64ec5be4.tar.zst
bun-706406af48aa43e218d9428761acfd1b64ec5be4.zip
remove leak
Diffstat (limited to 'src')
-rw-r--r--src/bun.js/bindings/bindings.cpp13
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))
* cleanup * cleanup 2 * oops * move _generateKeyPairSync checks to native 2023-10-07Exclude more filesGravatar Jarred Sumner 1-1/+1 2023-10-07Exclude more filesGravatar Jarred Sumner 1-1/+2 2023-10-07Update settings.jsonGravatar Jarred Sumner 1-1/+2 2023-10-07Update settings.jsonGravatar Jarred Sumner 1-2/+3 2023-10-06fix a couple install testsGravatar Dylan Conway 1-8/+8 2023-10-06formatGravatar Dylan Conway 1-1/+2 2023-10-06Fix memory leak in fetch() (#6350)Gravatar Jarred Sumner 1-2/+0 Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2023-10-06[types] allow onLoad plugin callbacks to return undefined (#6346)Gravatar Silver 1-1/+1 Returning undefined simply falls through to the next plugin, or to the default loader. This is defined by esbuild, and supported by Bun, but the types don't reflect it properly. 2023-10-06docs: `file.stream()` is not a promise (#6337)Gravatar Paul Nodet 1-1/+1