forked from rollup/rollup-docs-cn
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to redeclare parameters multiple times in nested scopes (#5276)
- Loading branch information
1 parent
b3132dd
commit 0bf5199
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
3 changes: 3 additions & 0 deletions
3
test/function/samples/ast-validations/redeclare-var-parameter-nested/_config.js
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: 'allows to redeclare parameters with multiple nested vars' | ||
}); |
21 changes: 21 additions & 0 deletions
21
test/function/samples/ast-validations/redeclare-var-parameter-nested/main.js
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 @@ | ||
export function f(val) { | ||
{ | ||
var val = 1; | ||
var val = 2; | ||
} | ||
assert.equal(val, 2); | ||
} | ||
f(0); | ||
|
||
export function g(val) { | ||
{ | ||
{ | ||
var val = 1; | ||
} | ||
{ | ||
var val = 2; | ||
} | ||
} | ||
assert.equal(val, 2); | ||
} | ||
g(0); |