Skip to content

Commit

Permalink
NativeError: Throw error if no arguments are passed to AggregateError
Browse files Browse the repository at this point in the history
  • Loading branch information
camnwalter authored and gbrail committed Sep 12, 2024
1 parent ffdf231 commit 44532cc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions rhino/src/main/java/org/mozilla/javascript/NativeError.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ static NativeError makeAggregate(
Scriptable newArray = cx.newArray(scope, errors.toArray());
obj.defineProperty("errors", newArray, DONTENUM);
}
} else {
throw ScriptRuntime.typeErrorById("msg.iterable.expected");
}
return obj;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -972,3 +972,7 @@ msg.promise.any.toobig =\

msg.typed.array.ctor.incompatible = \
Method %TypedArray%.prototype.{0} called on incompatible receiver

# NativeError
msg.iterable.expected =\
Expected the first argument to be iterable

0 comments on commit 44532cc

Please sign in to comment.