| 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 #include <fstream> | 5 #include <fstream> |
| 6 | 6 |
| 7 #include "src/v8.h" | 7 #include "src/v8.h" |
| 8 | 8 |
| 9 #include "src/interpreter/bytecode-array-iterator.h" | 9 #include "src/interpreter/bytecode-array-iterator.h" |
| 10 #include "src/interpreter/bytecode-generator.h" | 10 #include "src/interpreter/bytecode-generator.h" |
| (...skipping 2353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2364 "class A { constructor(...args) { this.args = args; } }\n" | 2364 "class A { constructor(...args) { this.args = args; } }\n" |
| 2365 "new A(0, ...[1, 2, 3]);\n", | 2365 "new A(0, ...[1, 2, 3]);\n", |
| 2366 | 2366 |
| 2367 "class A { constructor(...args) { this.args = args; } }\n" | 2367 "class A { constructor(...args) { this.args = args; } }\n" |
| 2368 "new A(0, ...[1, 2, 3], 4);\n"}; | 2368 "new A(0, ...[1, 2, 3], 4);\n"}; |
| 2369 | 2369 |
| 2370 CHECK(CompareTexts(BuildActual(printer, snippets), | 2370 CHECK(CompareTexts(BuildActual(printer, snippets), |
| 2371 LoadGolden("NewAndSpread.golden"))); | 2371 LoadGolden("NewAndSpread.golden"))); |
| 2372 } | 2372 } |
| 2373 | 2373 |
| 2374 TEST(AsyncFunctions) { |
| 2375 InitializedIgnitionHandleScope scope; |
| 2376 BytecodeExpectationsPrinter printer(CcTest::isolate()); |
| 2377 printer.set_wrap(false); |
| 2378 printer.set_test_function_name("f"); |
| 2379 |
| 2380 const char* snippets[] = { |
| 2381 "async function f() { }\n" |
| 2382 "f();\n", |
| 2383 |
| 2384 "async function f() { await 42 }\n" |
| 2385 "f();\n", |
| 2386 |
| 2387 "async function f() { for (let x of [42]) await x }\n" |
| 2388 "f();\n", |
| 2389 }; |
| 2390 |
| 2391 CHECK(CompareTexts(BuildActual(printer, snippets), |
| 2392 LoadGolden("AsyncFunctions.golden"))); |
| 2393 } |
| 2394 |
| 2374 } // namespace interpreter | 2395 } // namespace interpreter |
| 2375 } // namespace internal | 2396 } // namespace internal |
| 2376 } // namespace v8 | 2397 } // namespace v8 |
| OLD | NEW |