diff options
author | 2023-01-01 07:20:16 -0800 | |
---|---|---|
committer | 2023-01-01 07:20:16 -0800 | |
commit | 0b0aadfc5fb2d09b561a8f7f5d46afe68c8e7284 (patch) | |
tree | 2bead4a0b4d91dbbe25fc14d5c95906f52a2691b | |
parent | 905aff3cfcc31406aea875a8176bbc09c408e740 (diff) | |
download | bun-0b0aadfc5fb2d09b561a8f7f5d46afe68c8e7284.tar.gz bun-0b0aadfc5fb2d09b561a8f7f5d46afe68c8e7284.tar.zst bun-0b0aadfc5fb2d09b561a8f7f5d46afe68c8e7284.zip |
Make asPromise() and asInternalPromise() safer, but slower
-rw-r--r-- | src/bun.js/bindings/bindings.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
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<JSC::JSInternalPromise*>(value); + return JSC::jsDynamicCast<JSC::JSInternalPromise*>(value); } JSC__JSPromise* JSC__JSValue__asPromise(JSC__JSValue JSValue0) { JSC::JSValue value = JSC::JSValue::decode(JSValue0); - return JSC::jsCast<JSC::JSPromise*>(value); + return JSC::jsDynamicCast<JSC::JSPromise*>(value); } JSC__JSValue JSC__JSValue__createInternalPromise(JSC__JSGlobalObject* globalObject) { |