Skip to content

Commit

Permalink
address pr feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
DonIsaac committed Feb 5, 2025
1 parent 176552f commit d8f51f6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/bun.js/bindings/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1218,15 +1218,16 @@ std::optional<bool> specialObjectsDequal(JSC__JSGlobalObject* globalObject, Mark
// `.cause` is non-enumerable, so it must be checked explicitly.
// note that an undefined cause is different than a missing cause in
// strict mode.
const Identifier causeIdent = Identifier::fromString(vm, "cause"_s);
const PropertyName cause(causeIdent);
const PropertyName cause(vm.propertyNames->cause);
if constexpr (isStrict) {
if (left->hasProperty(globalObject, cause) != right->hasProperty(globalObject, cause)) {
return false;
}
}
auto leftCause = left->get(globalObject, cause);
RETURN_IF_EXCEPTION(*scope, false);
auto rightCause = right->get(globalObject, cause);
RETURN_IF_EXCEPTION(*scope, false);
if (!Bun__deepEquals<isStrict, enableAsymmetricMatchers>(globalObject, leftCause, rightCause, gcBuffer, stack, scope, true)) {
return false;
}
Expand Down Expand Up @@ -1254,7 +1255,7 @@ std::optional<bool> specialObjectsDequal(JSC__JSGlobalObject* globalObject, Mark
size_t i;
for (i = 0; i < propertyArrayLength1; i++) {
Identifier i1 = a1[i];
if (!i1.isEmpty() && !i1.isSymbol() && i1.string() == "stack"_s) continue;
if (i1 == vm.propertyNames->stack) continue;
PropertyName propertyName1 = PropertyName(i1);

JSValue prop1 = left->get(globalObject, propertyName1);
Expand Down Expand Up @@ -1287,6 +1288,7 @@ std::optional<bool> specialObjectsDequal(JSC__JSGlobalObject* globalObject, Mark
// for the remaining properties in the other object, make sure they are undefined
for (; i < propertyArrayLength2; i++) {
Identifier i2 = a2[i];
if (i2 == vm.propertyNames->stack) continue;
PropertyName propertyName2 = PropertyName(i2);

JSValue prop2 = right->getIfPropertyExists(globalObject, propertyName2);
Expand Down Expand Up @@ -1316,6 +1318,11 @@ std::optional<bool> specialObjectsDequal(JSC__JSGlobalObject* globalObject, Mark
if (!isTypedArrayType(static_cast<JSC::JSType>(c2Type)) || c1Type != c2Type) {
return false;
}
auto info = c1->classInfo();
auto info2 = c2->classInfo();
if (!info || !info2) {
return false;
}

JSC::JSArrayBufferView* left = jsCast<JSArrayBufferView*, JSCell>(c1);
JSC::JSArrayBufferView* right = jsCast<JSArrayBufferView*, JSCell>(c2);
Expand Down

0 comments on commit d8f51f6

Please sign in to comment.