| OLD | NEW |
| 1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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: --strong-mode --harmony-rest-parameters --harmony-arrow-functions | 5 // Flags: --strong-mode --harmony-rest-parameters --harmony-arrow-functions |
| 6 // Flags: --harmony-computed-property-names | 6 // Flags: --harmony-computed-property-names |
| 7 | 7 |
| 8 // Note that it's essential for these tests that the reference is inside dead | 8 // Note that it's essential for these tests that the reference is inside dead |
| 9 // code (because we already produce ReferenceErrors for run-time unresolved | 9 // code (because we already produce ReferenceErrors for run-time unresolved |
| 10 // variables and don't want to confuse those with strong mode errors). But the | 10 // variables and don't want to confuse those with strong mode errors). But the |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 } | 186 } |
| 187 | 187 |
| 188 let var5 = 5; | 188 let var5 = 5; |
| 189 for (; var5 < 10; ++var5) { } | 189 for (; var5 < 10; ++var5) { } |
| 190 | 190 |
| 191 let arr = [1, 2]; | 191 let arr = [1, 2]; |
| 192 for (let i of arr) { | 192 for (let i of arr) { |
| 193 i; | 193 i; |
| 194 } | 194 } |
| 195 | 195 |
| 196 let var6 = [1, 2]; | |
| 197 // The second var6 resolves to outside (not to the first var6). | |
| 198 for (let var6 of var6) { var6; } | |
| 199 | |
| 200 try { | 196 try { |
| 201 throw "error"; | 197 throw "error"; |
| 202 } catch (e) { | 198 } catch (e) { |
| 203 e; | 199 e; |
| 204 } | 200 } |
| 205 | 201 |
| 206 function func1() { func1; this; } | 202 function func1() { func1; this; } |
| 207 func1(); | 203 func1(); |
| 208 func1; | 204 func1; |
| 209 | 205 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 } | 247 } |
| 252 return new CInner(); | 248 return new CInner(); |
| 253 } | 249 } |
| 254 } | 250 } |
| 255 (new COuter()).m().n(); | 251 (new COuter()).m().n(); |
| 256 | 252 |
| 257 // Making sure the check which is supposed to prevent "object literal inside | 253 // Making sure the check which is supposed to prevent "object literal inside |
| 258 // computed property name references the class name" is not too generic: | 254 // computed property name references the class name" is not too generic: |
| 259 class C14 { m() { let obj = { n() { C14 } }; obj.n(); } }; (new C14()).m(); | 255 class C14 { m() { let obj = { n() { C14 } }; obj.n(); } }; (new C14()).m(); |
| 260 })(); | 256 })(); |
| OLD | NEW |