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 2214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2225 bool old_flag = FLAG_ignition_generators; | 2225 bool old_flag = FLAG_ignition_generators; |
2226 FLAG_ignition_generators = true; | 2226 FLAG_ignition_generators = true; |
2227 | 2227 |
2228 InitializedIgnitionHandleScope scope; | 2228 InitializedIgnitionHandleScope scope; |
2229 BytecodeExpectationsPrinter printer(CcTest::isolate(), | 2229 BytecodeExpectationsPrinter printer(CcTest::isolate(), |
2230 ConstantPoolType::kMixed); | 2230 ConstantPoolType::kMixed); |
2231 printer.set_wrap(false); | 2231 printer.set_wrap(false); |
2232 printer.set_test_function_name("f"); | 2232 printer.set_test_function_name("f"); |
2233 | 2233 |
2234 const char* snippets[] = { | 2234 const char* snippets[] = { |
2235 "function* f() { }\n", | 2235 "function* f() { }\n" |
| 2236 "f();\n", |
2236 | 2237 |
2237 "function* f() { yield 42 }\n", | 2238 "function* f() { yield 42 }\n" |
| 2239 "f();\n", |
2238 | 2240 |
2239 "function* f() { for (let x of [42]) yield x }\n", | 2241 "function* f() { for (let x of [42]) yield x }\n" |
| 2242 "f();\n", |
2240 }; | 2243 }; |
2241 | 2244 |
2242 CHECK(CompareTexts(BuildActual(printer, snippets), | 2245 CHECK(CompareTexts(BuildActual(printer, snippets), |
2243 LoadGolden("Generators.golden"))); | 2246 LoadGolden("Generators.golden"))); |
2244 | 2247 |
2245 FLAG_ignition_generators = old_flag; | 2248 FLAG_ignition_generators = old_flag; |
2246 } | 2249 } |
2247 | 2250 |
2248 } // namespace interpreter | 2251 } // namespace interpreter |
2249 } // namespace internal | 2252 } // namespace internal |
2250 } // namespace v8 | 2253 } // namespace v8 |
OLD | NEW |