Debian Codegraph @

js/src/tests/test262/language/statements/for/head-const-fresh-binding-per-iteration.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.6.4.13
5 description: >
6 const ForDeclaration: creates a fresh binding per iteration
7 ---*/
8
9 let z = 1;
10 let s = 0;
11 for (const x = 1; z < 2; z++) {
12 s += x + z;
13 }
14 assert.sameValue(s, 2, "The value of `s` is `2`");
15
16 reportCompare(0, 0);