Chromium Code Reviews| 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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 204 | 204 |
| 205 function func1() { func1; this; } | 205 function func1() { func1; this; } |
| 206 func1(); | 206 func1(); |
| 207 func1; | 207 func1; |
| 208 | 208 |
| 209 function * func2() { func2; this; } | 209 function * func2() { func2; this; } |
| 210 func2(); | 210 func2(); |
| 211 func2; | 211 func2; |
| 212 | 212 |
| 213 function func4(p, ...rest) { p; rest; this; func2; } | 213 function func4(p, ...rest) { p; rest; this; func2; } |
| 214 func4(); | 214 func4(1, 2); // FIXME |
|
rossberg
2015/05/05 14:26:20
Why FIXME?
arv (Not doing code reviews)
2015/05/05 16:46:29
Let me make that more explicit.
The arity checkin
| |
| 215 | 215 |
| 216 let func5 = (p1, p2) => { p1; p2; }; | 216 let func5 = (p1, p2) => { p1; p2; }; |
| 217 func5(); | 217 func5(1, 2); |
| 218 | 218 |
| 219 let func5b = p1 => p1; | 219 let func5b = p1 => p1; |
| 220 func5b(); | 220 func5b(1); |
| 221 | 221 |
| 222 function func6() { | 222 function func6() { |
| 223 var1, var2a, var2b, var2c; | 223 var1, var2a, var2b, var2c; |
| 224 } | 224 } |
| 225 | 225 |
| 226 class C1 { constructor() { C1; } }; new C1(); | 226 class C1 { constructor() { C1; } }; new C1(); |
| 227 let C2 = class C3 { constructor() { C3; } }; new C2(); | 227 let C2 = class C3 { constructor() { C3; } }; new C2(); |
| 228 | 228 |
| 229 class C4 { method() { C4; } *generator_method() { C4; } }; new C4(); | 229 class C4 { method() { C4; } *generator_method() { C4; } }; new C4(); |
| 230 let C5 = class C6 { method() { C6; } *generator_method() { C6; } }; new C5(); | 230 let C5 = class C6 { method() { C6; } *generator_method() { C6; } }; new C5(); |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 249 } | 249 } |
| 250 return new CInner(); | 250 return new CInner(); |
| 251 } | 251 } |
| 252 } | 252 } |
| 253 (new COuter()).m().n(); | 253 (new COuter()).m().n(); |
| 254 | 254 |
| 255 // 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 |
| 256 // computed property name references the class name" is not too generic: | 256 // computed property name references the class name" is not too generic: |
| 257 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(); |
| 258 })(); | 258 })(); |
| OLD | NEW |