Skip to content

Commit

Permalink
Do not throw error with Id_filter
Browse files Browse the repository at this point in the history
  • Loading branch information
tuchida authored and gbrail committed Feb 23, 2021
1 parent ac9ce64 commit 00ff021
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/org/mozilla/javascript/NativeArray.java
Original file line number Diff line number Diff line change
Expand Up @@ -1930,8 +1930,7 @@ private static Object iterativeMethod(Context cx, IdFunctionObject idFunctionObj
}

long length = getLengthProperty(cx, o);
// TODO: In the case of Id_filter, CreateDataPropertyOrThrow throws a TypeError instead of ArraySpeciesCreate.
if ((id == Id_map || id == Id_filter) && length > Integer.MAX_VALUE) {
if (id == Id_map && length > Integer.MAX_VALUE) {
String msg = ScriptRuntime.getMessageById("msg.arraylength.bad");
throw ScriptRuntime.rangeError(msg);
}
Expand Down

0 comments on commit 00ff021

Please sign in to comment.