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 // TODO(arv): The arity checking is not correct with rest parameters. |
| 215 func4(1, 2); |
215 | 216 |
216 let func5 = (p1, p2) => { p1; p2; }; | 217 let func5 = (p1, p2) => { p1; p2; }; |
217 func5(); | 218 func5(1, 2); |
218 | 219 |
219 let func5b = p1 => p1; | 220 let func5b = p1 => p1; |
220 func5b(); | 221 func5b(1); |
221 | 222 |
222 function func6() { | 223 function func6() { |
223 var1, var2a, var2b, var2c; | 224 var1, var2a, var2b, var2c; |
224 } | 225 } |
225 | 226 |
226 class C1 { constructor() { C1; } }; new C1(); | 227 class C1 { constructor() { C1; } }; new C1(); |
227 let C2 = class C3 { constructor() { C3; } }; new C2(); | 228 let C2 = class C3 { constructor() { C3; } }; new C2(); |
228 | 229 |
229 class C4 { method() { C4; } *generator_method() { C4; } }; new C4(); | 230 class C4 { method() { C4; } *generator_method() { C4; } }; new C4(); |
230 let C5 = class C6 { method() { C6; } *generator_method() { C6; } }; new C5(); | 231 let C5 = class C6 { method() { C6; } *generator_method() { C6; } }; new C5(); |
(...skipping 18 matching lines...) Expand all Loading... |
249 } | 250 } |
250 return new CInner(); | 251 return new CInner(); |
251 } | 252 } |
252 } | 253 } |
253 (new COuter()).m().n(); | 254 (new COuter()).m().n(); |
254 | 255 |
255 // Making sure the check which is supposed to prevent "object literal inside | 256 // Making sure the check which is supposed to prevent "object literal inside |
256 // computed property name references the class name" is not too generic: | 257 // computed property name references the class name" is not too generic: |
257 class C14 { m() { let obj = { n() { C14 } }; obj.n(); } }; (new C14()).m(); | 258 class C14 { m() { let obj = { n() { C14 } }; obj.n(); } }; (new C14()).m(); |
258 })(); | 259 })(); |
OLD | NEW |