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

Side by Side Diff: test/cctest/interpreter/test-bytecode-generator.cc

Issue 2423053002: Install the 'name' property in classes at runtime (Closed)
Patch Set: rebased Created 4 years 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 unified diff | Download patch
OLDNEW
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 2124 matching lines...) Expand 10 before | Expand all | Expand 10 after
2135 "var n0 = 'a';\n" 2135 "var n0 = 'a';\n"
2136 "var n1 = 'b';\n" 2136 "var n1 = 'b';\n"
2137 "class N {\n" 2137 "class N {\n"
2138 " [n0]() { return n0; }\n" 2138 " [n0]() { return n0; }\n"
2139 " static [n1]() { return n1; }\n" 2139 " static [n1]() { return n1; }\n"
2140 "}\n", 2140 "}\n",
2141 2141
2142 "var count = 0;\n" 2142 "var count = 0;\n"
2143 "class C { constructor() { count++; }}\n" 2143 "class C { constructor() { count++; }}\n"
2144 "return new C();\n", 2144 "return new C();\n",
2145
2146 "(class {})\n"
2147 "class E { static name () {}}\n",
2145 }; 2148 };
2146 2149
2147 CHECK(CompareTexts(BuildActual(printer, snippets), 2150 CHECK(CompareTexts(BuildActual(printer, snippets),
2148 LoadGolden("ClassDeclarations.golden"))); 2151 LoadGolden("ClassDeclarations.golden")));
2149 } 2152 }
2150 2153
2151 TEST(ClassAndSuperClass) { 2154 TEST(ClassAndSuperClass) {
2152 InitializedIgnitionHandleScope scope; 2155 InitializedIgnitionHandleScope scope;
2153 BytecodeExpectationsPrinter printer(CcTest::isolate()); 2156 BytecodeExpectationsPrinter printer(CcTest::isolate());
2154 printer.set_wrap(false); 2157 printer.set_wrap(false);
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
2309 "})();\n", 2312 "})();\n",
2310 }; 2313 };
2311 2314
2312 CHECK(CompareTexts(BuildActual(printer, snippets), 2315 CHECK(CompareTexts(BuildActual(printer, snippets),
2313 LoadGolden("SuperCallAndSpread.golden"))); 2316 LoadGolden("SuperCallAndSpread.golden")));
2314 } 2317 }
2315 2318
2316 } // namespace interpreter 2319 } // namespace interpreter
2317 } // namespace internal 2320 } // namespace internal
2318 } // namespace v8 2321 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698