| 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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 function * func2() { func2; this; } | 201 function * func2() { func2; this; } |
| 202 func2(); | 202 func2(); |
| 203 func2; | 203 func2; |
| 204 | 204 |
| 205 function func4(p, ...rest) { p; rest; this; func2; } | 205 function func4(p, ...rest) { p; rest; this; func2; } |
| 206 func4(); | 206 func4(); |
| 207 | 207 |
| 208 let func5 = (p1, p2) => { p1; p2; }; | 208 let func5 = (p1, p2) => { p1; p2; }; |
| 209 func5(); | 209 func5(); |
| 210 | 210 |
| 211 let func5b = p1 => p1; |
| 212 func5b(); |
| 213 |
| 211 function func6() { | 214 function func6() { |
| 212 var1, var2a, var2b, var2c; | 215 var1, var2a, var2b, var2c; |
| 213 } | 216 } |
| 214 | 217 |
| 215 (function eval1() { | 218 (function eval1() { |
| 216 let var7 = 0; // Declaration position will be something large. | 219 let var7 = 0; // Declaration position will be something large. |
| 217 // But use position will be something small, however, this is not an error, | 220 // But use position will be something small, however, this is not an error, |
| 218 // since the use is inside an eval scope. | 221 // since the use is inside an eval scope. |
| 219 eval("var7;"); | 222 eval("var7;"); |
| 220 })(); | 223 })(); |
| (...skipping 25 matching lines...) Expand all Loading... |
| 246 } | 249 } |
| 247 return new CInner(); | 250 return new CInner(); |
| 248 } | 251 } |
| 249 } | 252 } |
| 250 (new COuter()).m().n(); | 253 (new COuter()).m().n(); |
| 251 | 254 |
| 252 // Making sure the check which is supposed to prevent "object literal inside | 255 // Making sure the check which is supposed to prevent "object literal inside |
| 253 // computed property name references the class name" is not too generic: | 256 // computed property name references the class name" is not too generic: |
| 254 class C14 { m() { let obj = { n() { C14 } }; obj.n(); } }; (new C14()).m(); | 257 class C14 { m() { let obj = { n() { C14 } }; obj.n(); } }; (new C14()).m(); |
| 255 })(); | 258 })(); |
| OLD | NEW |