Skip to content

Commit bd1e792

Browse files
author
Kevin Smith
committed
Loosen assertion for arrays with non-writable length
1 parent 2b3c566 commit bd1e792

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/Runtime/Language/JavascriptOperators.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9070,7 +9070,13 @@ using namespace Js;
90709070
BOOL tempResult = obj->SetPropertyWithAttributes(propId, filledDescriptor.GetValue(), filledDescriptor.GetAttributes(), nullptr);
90719071
if (!obj->IsExternal() && !tempResult)
90729072
{
9073-
Assert(VarIs<TypedArrayBase>(obj)); // typed array returns false when canonical numeric index is not integer or out of range
9073+
Assert(
9074+
// Arrays return false when length property is non-writable and property is numeric
9075+
// and greater than or equal to length
9076+
DynamicObject::IsAnyArray(obj) ||
9077+
// Typed arrays return false when canonical numeric index is not integer or out of range
9078+
DynamicObject::IsAnyTypedArray(obj)
9079+
);
90749080
return FALSE;
90759081
}
90769082
}

0 commit comments

Comments
 (0)