Index: test/cctest/interpreter/test-bytecode-generator.cc |
diff --git a/test/cctest/interpreter/test-bytecode-generator.cc b/test/cctest/interpreter/test-bytecode-generator.cc |
index b43384e9463cbf573be20fa66f000d6297296a84..85c1c43874058dbfcc29eb75f95a21baf67504dd 100644 |
--- a/test/cctest/interpreter/test-bytecode-generator.cc |
+++ b/test/cctest/interpreter/test-bytecode-generator.cc |
@@ -2343,6 +2343,34 @@ TEST(SuperCallAndSpread) { |
LoadGolden("SuperCallAndSpread.golden"))); |
} |
+TEST(CallAndSpread) { |
+ InitializedIgnitionHandleScope scope; |
+ BytecodeExpectationsPrinter printer(CcTest::isolate()); |
+ const char* snippets[] = {"Math.max(...[1, 2, 3]);\n", |
+ "Math.max(0, ...[1, 2, 3]);\n", |
+ "Math.max(0, ...[1, 2, 3], 4);\n"}; |
+ |
+ CHECK(CompareTexts(BuildActual(printer, snippets), |
+ LoadGolden("CallAndSpread.golden"))); |
+} |
+ |
+TEST(NewAndSpread) { |
+ InitializedIgnitionHandleScope scope; |
+ BytecodeExpectationsPrinter printer(CcTest::isolate()); |
+ const char* snippets[] = { |
+ "class A { constructor(...args) { this.args = args; } }\n" |
+ "new A(...[1, 2, 3]);\n", |
+ |
+ "class A { constructor(...args) { this.args = args; } }\n" |
+ "new A(0, ...[1, 2, 3]);\n", |
+ |
+ "class A { constructor(...args) { this.args = args; } }\n" |
+ "new A(0, ...[1, 2, 3], 4);\n"}; |
+ |
+ CHECK(CompareTexts(BuildActual(printer, snippets), |
+ LoadGolden("NewAndSpread.golden"))); |
+} |
+ |
} // namespace interpreter |
} // namespace internal |
} // namespace v8 |