Skip to content

Commit

Permalink
Work around a bug in Rhino
Browse files Browse the repository at this point in the history
Rhino does not like it when the Array constructor is called with this set
to null.  We therefore use .slice() instead to create a copy of the array.
  • Loading branch information
fstirlitz committed May 31, 2021
1 parent 153842a commit 5015784
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion luaparse.js
Original file line number Diff line number Diff line change
Expand Up @@ -1465,7 +1465,7 @@

// Create a new scope inheriting all declarations from the previous scope.
function createScope() {
var scope = Array.apply(null, scopes[scopeDepth++]);
var scope = scopes[scopeDepth++].slice();
scopes.push(scope);
if (options.onCreateScope) options.onCreateScope();
}
Expand Down

0 comments on commit 5015784

Please sign in to comment.