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

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

Issue 2423053002: Install the 'name' property in classes at runtime (Closed)
Patch Set: Created 4 years, 2 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 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 2102 matching lines...) Expand 10 before | Expand all | Expand 10 after
2113 "var n0 = 'a';\n" 2113 "var n0 = 'a';\n"
2114 "var n1 = 'b';\n" 2114 "var n1 = 'b';\n"
2115 "class N {\n" 2115 "class N {\n"
2116 " [n0]() { return n0; }\n" 2116 " [n0]() { return n0; }\n"
2117 " static [n1]() { return n1; }\n" 2117 " static [n1]() { return n1; }\n"
2118 "}\n", 2118 "}\n",
2119 2119
2120 "var count = 0;\n" 2120 "var count = 0;\n"
2121 "class C { constructor() { count++; }}\n" 2121 "class C { constructor() { count++; }}\n"
2122 "return new C();\n", 2122 "return new C();\n",
2123
2124 "(class {})\n"
2125 "class E { static name () {}}\n"
2123 }; 2126 };
2124 2127
2125 CHECK(CompareTexts(BuildActual(printer, snippets), 2128 CHECK(CompareTexts(BuildActual(printer, snippets),
2126 LoadGolden("ClassDeclarations.golden"))); 2129 LoadGolden("ClassDeclarations.golden")));
2127 } 2130 }
2128 2131
2129 TEST(ClassAndSuperClass) { 2132 TEST(ClassAndSuperClass) {
2130 InitializedIgnitionHandleScope scope; 2133 InitializedIgnitionHandleScope scope;
2131 BytecodeExpectationsPrinter printer(CcTest::isolate()); 2134 BytecodeExpectationsPrinter printer(CcTest::isolate());
2132 printer.set_wrap(false); 2135 printer.set_wrap(false);
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
2201 "f();\n", 2204 "f();\n",
2202 }; 2205 };
2203 2206
2204 CHECK(CompareTexts(BuildActual(printer, snippets), 2207 CHECK(CompareTexts(BuildActual(printer, snippets),
2205 LoadGolden("Generators.golden"))); 2208 LoadGolden("Generators.golden")));
2206 } 2209 }
2207 2210
2208 } // namespace interpreter 2211 } // namespace interpreter
2209 } // namespace internal 2212 } // namespace internal
2210 } // namespace v8 2213 } // namespace v8
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698