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 2228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2239 "export * from \"bar\"\n", | 2239 "export * from \"bar\"\n", |
2240 | 2240 |
2241 "import * as foo from \"bar\"\n" | 2241 "import * as foo from \"bar\"\n" |
2242 "foo.f(foo, foo.x);\n", | 2242 "foo.f(foo, foo.x);\n", |
2243 }; | 2243 }; |
2244 | 2244 |
2245 CHECK(CompareTexts(BuildActual(printer, snippets), | 2245 CHECK(CompareTexts(BuildActual(printer, snippets), |
2246 LoadGolden("Modules.golden"))); | 2246 LoadGolden("Modules.golden"))); |
2247 } | 2247 } |
2248 | 2248 |
| 2249 TEST(SuperCallAndSpread) { |
| 2250 InitializedIgnitionHandleScope scope; |
| 2251 BytecodeExpectationsPrinter printer(CcTest::isolate()); |
| 2252 printer.set_wrap(false); |
| 2253 printer.set_test_function_name("test"); |
| 2254 const char* snippets[] = { |
| 2255 "var test;\n" |
| 2256 "(function() {\n" |
| 2257 " class A {\n" |
| 2258 " constructor(...args) { this.baseArgs = args; }\n" |
| 2259 " }\n" |
| 2260 " class B extends A {}\n" |
| 2261 " test = new B(1, 2, 3).constructor;\n" |
| 2262 "})();\n", |
| 2263 |
| 2264 "var test;\n" |
| 2265 "(function() {\n" |
| 2266 " class A {\n" |
| 2267 " constructor(...args) { this.baseArgs = args; }\n" |
| 2268 " }\n" |
| 2269 " class B extends A {\n" |
| 2270 " constructor(...args) { super(1, ...args); }\n" |
| 2271 " }\n" |
| 2272 " test = new B(1, 2, 3).constructor;\n" |
| 2273 "})();\n", |
| 2274 |
| 2275 "var test;\n" |
| 2276 "(function() {\n" |
| 2277 " class A {\n" |
| 2278 " constructor(...args) { this.baseArgs = args; }\n" |
| 2279 " }\n" |
| 2280 " class B extends A {\n" |
| 2281 " constructor(...args) { super(1, ...args, 1); }\n" |
| 2282 " }\n" |
| 2283 " test = new B(1, 2, 3).constructor;\n" |
| 2284 "})();\n", |
| 2285 }; |
| 2286 |
| 2287 CHECK(CompareTexts(BuildActual(printer, snippets), |
| 2288 LoadGolden("SuperCallAndSpread.golden"))); |
| 2289 } |
| 2290 |
2249 } // namespace interpreter | 2291 } // namespace interpreter |
2250 } // namespace internal | 2292 } // namespace internal |
2251 } // namespace v8 | 2293 } // namespace v8 |
OLD | NEW |