OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |