Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1189)

Unified Diff: test/cctest/interpreter/test-bytecode-generator.cc

Issue 2629363002: [Ignition/turbo] Add a CallWithSpread bytecode. (Closed)
Patch Set: reparent on the bytecode CL Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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
« no previous file with comments | « test/cctest/interpreter/bytecode_expectations/NewAndSpread.golden ('k') | test/mjsunit/regress/regress-682242.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698