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