Debian Codegraph @

js/src/tests/test262/language/block-scope/shadowing/parameter-name-shadowing-parameter-name-let-const-and-var.js

raw
1 // Copyright (C) 2011 the V8 project authors. All rights reserved.
2 // This code is governed by the BSD license found in the LICENSE file.
3 /*---
4 es6id: 13.1
5 description: >
6 parameter name shadowing parameter name, let, const and var
7 ---*/
8 function fn(a) {
9 let b = 1;
10 var c = 1;
11 const d = 1;
12
13 (function(a, b, c, d) {
14 a = 2;
15 b = 2;
16 c = 2;
17 d = 2;
18
19 assert.sameValue(a, 2);
20 assert.sameValue(b, 2);
21 assert.sameValue(c, 2);
22 assert.sameValue(d, 2);
23 })(1, 1);
24
25 assert.sameValue(a, 1);
26 assert.sameValue(b, 1);
27 assert.sameValue(c, 1);
28 assert.sameValue(d, 1);
29 }
30
31 fn(1);
32
33
34 reportCompare(0, 0);