Files
bun.sh/deepequals_fix.patch

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;