mirror of
https://github.com/oven-sh/bun
synced 2026-02-13 12:29:07 +00:00
15 lines
692 B
Diff
15 lines
692 B
Diff
--- a/src/bun.js/bindings/bindings.cpp
|
|
+++ b/src/bun.js/bindings/bindings.cpp
|
|
@@ -270,6 +270,11 @@ bool readFlagsAndProcessPromise(JSValue& instanceValue, ExpectFlags& flags, JSG
|
|
|
|
AsymmetricMatcherResult matchAsymmetricMatcherAndGetFlags(JSGlobalObject* globalObject, JSValue matcherProp, JSValue otherProp, ThrowScope* throwScope, ExpectFlags& flags)
|
|
{
|
|
+ // Add check to ensure matcherProp is actually a cell before calling asCell()
|
|
+ if (!matcherProp.isCell()) {
|
|
+ return AsymmetricMatcherResult::NOT_MATCHER;
|
|
+ }
|
|
+
|
|
JSCell* matcherPropCell = matcherProp.asCell();
|
|
AsymmetricMatcherConstructorType constructorType = AsymmetricMatcherConstructorType::none;
|
|
|