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

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

Issue 2423053002: Install the 'name' property in classes at runtime (Closed)
Patch Set: Check for 'name' properties at parse-time 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 2100 matching lines...) Expand 10 before | Expand all | Expand 10 after
2111 "var n0 = 'a';\n" 2111 "var n0 = 'a';\n"
2112 "var n1 = 'b';\n" 2112 "var n1 = 'b';\n"
2113 "class N {\n" 2113 "class N {\n"
2114 " [n0]() { return n0; }\n" 2114 " [n0]() { return n0; }\n"
2115 " static [n1]() { return n1; }\n" 2115 " static [n1]() { return n1; }\n"
2116 "}\n", 2116 "}\n",
2117 2117
2118 "var count = 0;\n" 2118 "var count = 0;\n"
2119 "class C { constructor() { count++; }}\n" 2119 "class C { constructor() { count++; }}\n"
2120 "return new C();\n", 2120 "return new C();\n",
2121
2122 "(class {})\n"
2123 "class E { static name () {}}\n",
2121 }; 2124 };
2122 2125
2123 CHECK(CompareTexts(BuildActual(printer, snippets), 2126 CHECK(CompareTexts(BuildActual(printer, snippets),
2124 LoadGolden("ClassDeclarations.golden"))); 2127 LoadGolden("ClassDeclarations.golden")));
2125 } 2128 }
2126 2129
2127 TEST(ClassAndSuperClass) { 2130 TEST(ClassAndSuperClass) {
2128 InitializedIgnitionHandleScope scope; 2131 InitializedIgnitionHandleScope scope;
2129 BytecodeExpectationsPrinter printer(CcTest::isolate()); 2132 BytecodeExpectationsPrinter printer(CcTest::isolate());
2130 printer.set_wrap(false); 2133 printer.set_wrap(false);
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
2240 "export * from \"bar\"\n", 2243 "export * from \"bar\"\n",
2241 }; 2244 };
2242 2245
2243 CHECK(CompareTexts(BuildActual(printer, snippets), 2246 CHECK(CompareTexts(BuildActual(printer, snippets),
2244 LoadGolden("Modules.golden"))); 2247 LoadGolden("Modules.golden")));
2245 } 2248 }
2246 2249
2247 } // namespace interpreter 2250 } // namespace interpreter
2248 } // namespace internal 2251 } // namespace internal
2249 } // namespace v8 2252 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698