Debian Codegraph @

js/src/tests/test262/language/statements/for-of/int8array.js

raw
1 // Copyright (C) 2015 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
5 description: >
6 Int8Array instances should be able to be traversed using a `for..of` loop.
7 features: [TypedArray]
8 ---*/
9
10 var iterationCount = 0;
11 var array = new Int8Array([3, 2, 4, 1]);
12
13 var first = 3;
14 var second = 2;
15 var third = 4;
16 var fourth = 1;
17
18 for (var x of array) {
19 assert.sameValue(x, first);
20
21 first = second;
22 second = third;
23 third = fourth;
24 fourth = null;
25
26 iterationCount += 1;
27 }
28
29 assert.sameValue(iterationCount, 4);
30
31 reportCompare(0, 0);