| 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 | |
| 7 | 6 |
| 8 // 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 |
| 9 // code (because we already produce ReferenceErrors for run-time unresolved | 8 // 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 | 9 // variables and don't want to confuse those with strong mode errors). But the |
| 11 // errors should *not* be inside lazy, unexecuted functions, since lazy parsing | 10 // errors should *not* be inside lazy, unexecuted functions, since lazy parsing |
| 12 // doesn't produce strong mode scoping errors). | 11 // doesn't produce strong mode scoping errors). |
| 13 | 12 |
| 14 // In addition, assertThrows will call eval and that changes variable binding | 13 // In addition, assertThrows will call eval and that changes variable binding |
| 15 // types (see e.g., UNBOUND_EVAL_SHADOWED). We can avoid unwanted side effects | 14 // types (see e.g., UNBOUND_EVAL_SHADOWED). We can avoid unwanted side effects |
| 16 // by wrapping the code to be tested inside an outer function. | 15 // by wrapping the code to be tested inside an outer function. |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 } | 246 } |
| 248 return new CInner(); | 247 return new CInner(); |
| 249 } | 248 } |
| 250 } | 249 } |
| 251 (new COuter()).m().n(); | 250 (new COuter()).m().n(); |
| 252 | 251 |
| 253 // 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 |
| 254 // computed property name references the class name" is not too generic: | 253 // computed property name references the class name" is not too generic: |
| 255 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(); |
| 256 })(); | 255 })(); |
| OLD | NEW |