Skip to content

Commit

Permalink
NativeCall: Fix not binding rest arg identifiers
Browse files Browse the repository at this point in the history
  • Loading branch information
mattco98 committed Jan 7, 2024
1 parent 739c705 commit c32f0be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/java/org/mozilla/javascript/NativeCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static void init(Scriptable scope, boolean sealed) {
int paramAndVarCount = function.getParamAndVarCount();
int paramCount = function.getParamCount();
if (paramAndVarCount != 0) {
for (int i = 0; i < paramCount; ++i) {
for (int i = 0; i < paramCount + (function.hasRest() ? 1 : 0); ++i) {
String name = function.getParamOrVarName(i);
Object val = i < this.effectiveArgs.length ? this.effectiveArgs[i] : Undefined.instance;
defineProperty(name, val, NOT_CONFIGURABLE);
Expand Down

0 comments on commit c32f0be

Please sign in to comment.