Skip to content

Commit 30bd6a8

Browse files
committed
Apparently the typecheck was necessary for the int case as well.
I decided to accept only TaggedInt and thus removing the need to check for MissingItem
1 parent 26e3e74 commit 30bd6a8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

lib/Runtime/Language/JavascriptOperators.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4685,12 +4685,12 @@ namespace Js
46854685
}
46864686
else if (instanceType == TypeIds_NativeIntArray)
46874687
{
4688-
int32 intValue = JavascriptConversion::ToInt32(value, scriptContext);
4689-
// Special case for missing item
4690-
if (SparseArraySegment<int32>::IsMissingItem(&intValue))
4688+
// Only accept tagged int. Also covers case for MissingItem
4689+
if (!TaggedInt::Is(value))
46914690
{
46924691
return false;
46934692
}
4693+
int32 intValue = JavascriptConversion::ToInt32(value, scriptContext);
46944694
returnValue = JavascriptArray::FromVar(instance)->DirectSetItemAtRange<int32>(start, length, intValue);
46954695
}
46964696
else

0 commit comments

Comments
 (0)