-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: rest element should deoptimize parameter values
- Loading branch information
Showing
3 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = defineTest({ | ||
description: 'restelement argument should deoptimize parameter value' | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
let hasArg0 = false; | ||
let hasArg1 = false; | ||
let hasArg2 = false; | ||
|
||
function foo(arg0, arg1, arg2) { | ||
if (arg0) { | ||
hasArg0 = true; | ||
} | ||
if (arg1) { | ||
hasArg1 = true; | ||
} | ||
if (arg2) { | ||
hasArg2 = true; | ||
} | ||
} | ||
|
||
foo(...['arg0', 'arg1']); | ||
|
||
assert.equal(hasArg0, true); | ||
assert.equal(hasArg1, true); | ||
assert.equal(hasArg2, false); |