Commit a176aec7 authored by Leszek Swirski's avatar Leszek Swirski Committed by Commit Bot

[ignition] Add golden files for destructuring assignment

Change-Id: I71c6e52229cae2aba0a5aec1844c0643484354e5
Reviewed-on: https://chromium-review.googlesource.com/c/1375657Reviewed-by: 's avatarRoss McIlroy <rmcilroy@chromium.org>
Commit-Queue: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58218}
parent a4e445a1
......@@ -2270,6 +2270,33 @@ TEST(AssignmentsInBinaryExpression) {
LoadGolden("AssignmentsInBinaryExpression.golden")));
}
TEST(DestructuringAssignment) {
InitializedIgnitionHandleScope scope;
BytecodeExpectationsPrinter printer(CcTest::isolate());
const char* snippets[] = {
"var x, a = [0,1,2,3];\n"
"[x] = a;\n",
"var x, y, a = [0,1,2,3];\n"
"[,x,...y] = a;\n",
"var x={}, y, a = [0];\n"
"[x.foo,y=4] = a;\n",
"var x, a = {x:1};\n"
"({x} = a);\n",
"var x={}, a = {y:1};\n"
"({y:x.foo} = a);\n",
"var x, a = {y:1, w:2, v:3};\n"
"({x=0,...y} = a);\n",
};
CHECK(CompareTexts(BuildActual(printer, snippets),
LoadGolden("DestructuringAssignment.golden")));
}
TEST(Eval) {
InitializedIgnitionHandleScope scope;
BytecodeExpectationsPrinter printer(CcTest::isolate());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment