From 0b0aadfc5fb2d09b561a8f7f5d46afe68c8e7284 Mon Sep 17 00:00:00 2001 From: Jarred SUmner Date: Sun, 1 Jan 2023 07:20:16 -0800 Subject: Make asPromise() and asInternalPromise() safer, but slower --- src/bun.js/bindings/bindings.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bun.js') diff --git a/src/bun.js/bindings/bindings.cpp b/src/bun.js/bindings/bindings.cpp index b10fcc872..f73a1b6e0 100644 --- a/src/bun.js/bindings/bindings.cpp +++ b/src/bun.js/bindings/bindings.cpp @@ -1131,13 +1131,13 @@ void JSC__JSValue__putRecord(JSC__JSValue objectValue, JSC__JSGlobalObject* glob JSC__JSInternalPromise* JSC__JSValue__asInternalPromise(JSC__JSValue JSValue0) { JSC::JSValue value = JSC::JSValue::decode(JSValue0); - return JSC::jsCast(value); + return JSC::jsDynamicCast(value); } JSC__JSPromise* JSC__JSValue__asPromise(JSC__JSValue JSValue0) { JSC::JSValue value = JSC::JSValue::decode(JSValue0); - return JSC::jsCast(value); + return JSC::jsDynamicCast(value); } JSC__JSValue JSC__JSValue__createInternalPromise(JSC__JSGlobalObject* globalObject) { -- cgit v1.2.3