| 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/compiler.h" | 9 #include "src/compiler.h" |
| 10 #include "src/interpreter/bytecode-array-iterator.h" | 10 #include "src/interpreter/bytecode-array-iterator.h" |
| (...skipping 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2217 " }\n" | 2217 " }\n" |
| 2218 " test = new B().constructor;\n" | 2218 " test = new B().constructor;\n" |
| 2219 "})();\n", | 2219 "})();\n", |
| 2220 }; | 2220 }; |
| 2221 | 2221 |
| 2222 CHECK(CompareTexts(BuildActual(printer, snippets), | 2222 CHECK(CompareTexts(BuildActual(printer, snippets), |
| 2223 LoadGolden("ClassAndSuperClass.golden"))); | 2223 LoadGolden("ClassAndSuperClass.golden"))); |
| 2224 } | 2224 } |
| 2225 | 2225 |
| 2226 TEST(Generators) { | 2226 TEST(Generators) { |
| 2227 bool old_flag = FLAG_ignition_generators; | |
| 2228 FLAG_ignition_generators = true; | |
| 2229 | |
| 2230 InitializedIgnitionHandleScope scope; | 2227 InitializedIgnitionHandleScope scope; |
| 2231 BytecodeExpectationsPrinter printer(CcTest::isolate(), | 2228 BytecodeExpectationsPrinter printer(CcTest::isolate(), |
| 2232 ConstantPoolType::kMixed); | 2229 ConstantPoolType::kMixed); |
| 2233 printer.set_wrap(false); | 2230 printer.set_wrap(false); |
| 2234 printer.set_test_function_name("f"); | 2231 printer.set_test_function_name("f"); |
| 2235 | 2232 |
| 2236 const char* snippets[] = { | 2233 const char* snippets[] = { |
| 2237 "function* f() { }\n" | 2234 "function* f() { }\n" |
| 2238 "f();\n", | 2235 "f();\n", |
| 2239 | 2236 |
| 2240 "function* f() { yield 42 }\n" | 2237 "function* f() { yield 42 }\n" |
| 2241 "f();\n", | 2238 "f();\n", |
| 2242 | 2239 |
| 2243 "function* f() { for (let x of [42]) yield x }\n" | 2240 "function* f() { for (let x of [42]) yield x }\n" |
| 2244 "f();\n", | 2241 "f();\n", |
| 2245 }; | 2242 }; |
| 2246 | 2243 |
| 2247 CHECK(CompareTexts(BuildActual(printer, snippets), | 2244 CHECK(CompareTexts(BuildActual(printer, snippets), |
| 2248 LoadGolden("Generators.golden"))); | 2245 LoadGolden("Generators.golden"))); |
| 2249 | |
| 2250 FLAG_ignition_generators = old_flag; | |
| 2251 } | 2246 } |
| 2252 | 2247 |
| 2253 } // namespace interpreter | 2248 } // namespace interpreter |
| 2254 } // namespace internal | 2249 } // namespace internal |
| 2255 } // namespace v8 | 2250 } // namespace v8 |
| OLD | NEW |