OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Flags: --expose-debug-as debug --harmony | 5 // Flags: --expose-debug-as debug --harmony |
6 | 6 |
7 Debug = debug.Debug; | 7 Debug = debug.Debug; |
8 var break_count = 0 | 8 var break_count = 0 |
9 var exception = null; | 9 var exception = null; |
10 var log = [] | 10 var log = [] |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 79 } |
80 } | 80 } |
81 | 81 |
82 Debug.setListener(listener); | 82 Debug.setListener(listener); |
83 f(); | 83 f(); |
84 Debug.setListener(null); // Break z | 84 Debug.setListener(null); // Break z |
85 | 85 |
86 print("log:\n"+ JSON.stringify(log)); | 86 print("log:\n"+ JSON.stringify(log)); |
87 // The let declaration differs from var in that the loop variable | 87 // The let declaration differs from var in that the loop variable |
88 // is declared in every iteration. | 88 // is declared in every iteration. |
| 89 // TODO(verwaest): For-of has hacky position numbers for Symbol.iterator and |
| 90 // .next. Restore to proper positions once the CallPrinter can disambiguate |
| 91 // based on other values. |
89 var expected = [ | 92 var expected = [ |
90 // Entry | 93 // Entry |
91 "a2","b2", | 94 "a2","b2", |
92 // Empty for-in-var: get enumerable | 95 // Empty for-in-var: get enumerable |
93 "c16", | 96 "c16", |
94 // Empty for-in: get enumerable | 97 // Empty for-in: get enumerable |
95 "d12", | 98 "d12", |
96 // For-in-var: get enumerable, assign, body, assign, body, ... | 99 // For-in-var: get enumerable, assign, body, assign, body, ... |
97 "e16","e11","E4","e11","E4","e11","E4","e11", | 100 "e16","e11","E4","e11","E4","e11","E4","e11", |
98 // For-in: get enumerable, assign, body, assign, body, ... | 101 // For-in: get enumerable, assign, body, assign, body, ... |
99 "f12","f7","F4","f7","F4","f7","F4","f7", | 102 "f12","f7","F4","f7","F4","f7","F4","f7", |
100 // For-in-let: get enumerable, next, body, next, ... | 103 // For-in-let: get enumerable, next, body, next, ... |
101 "g16","g11","G4","g11","G4","g11","G4","g11", | 104 "g16","g11","G4","g11","G4","g11","G4","g11", |
102 // For-of-var: next(), body, next(), body, ... | 105 // For-of-var: [Symbol.iterator](), next(), body, next(), body, ... |
103 "h16","H4","h16","H4","h16","H4","h16", | 106 "h16","h14","h15","H4","h15","H4","h15","H4","h15", |
104 // For-of: next(), body, next(), body, ... | 107 // For-of: [Symbol.iterator](), next(), body, next(), body, ... |
105 "i12","I4","i12","I4","i12","I4","i12", | 108 "i12","i10","i11","I4","i11","I4","i11","I4","i11", |
106 // For-of-let: next(), body, next(), ... | 109 // For-of-let: [Symbol.iterator](), next(), body, next(), ... |
107 "j16","J4","j16","J4","j16","J4","j16", | 110 "j16","j14","j15","J4","j15","J4","j15","J4","j15", |
108 // For-var: var decl, condition, body, next, condition, body, ... | 111 // For-var: var decl, condition, body, next, condition, body, ... |
109 "k7","k20","K4","k26","k20","K4","k26","k20","K4","k26","k20", | 112 "k7","k20","K4","k26","k20","K4","k26","k20","K4","k26","k20", |
110 // For: init, condition, body, next, condition, body, ... | 113 // For: init, condition, body, next, condition, body, ... |
111 "l7","l16","L4","l22","l16","L4","l22","l16","L4","l22","l16", | 114 "l7","l16","L4","l22","l16","L4","l22","l16","L4","l22","l16", |
112 // For-let: init, condition, body, next, condition, body, ... | 115 // For-let: init, condition, body, next, condition, body, ... |
113 "m7","m20","M4","m26","m20","M4","m26","m20","M4","m26","m20", | 116 "m7","m20","M4","m26","m20","M4","m26","m20","M4","m26","m20", |
114 // Exit. | 117 // Exit. |
115 "y0","z0", | 118 "y0","z0", |
116 ] | 119 ] |
117 print("expected:\n"+ JSON.stringify(expected)); | 120 print("expected:\n"+ JSON.stringify(expected)); |
118 | 121 |
119 assertArrayEquals(expected, log); | 122 assertArrayEquals(expected, log); |
120 assertEquals(54, s); | 123 assertEquals(54, s); |
121 assertNull(exception); | 124 assertNull(exception); |
OLD | NEW |