| 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 "src/v8.h" | 5 #include "src/v8.h" | 
| 6 | 6 | 
| 7 #include "src/execution.h" | 7 #include "src/execution.h" | 
| 8 #include "src/handles.h" | 8 #include "src/handles.h" | 
| 9 #include "src/interpreter/bytecode-array-builder.h" | 9 #include "src/interpreter/bytecode-array-builder.h" | 
| 10 #include "src/interpreter/bytecode-array-iterator.h" | 10 #include "src/interpreter/bytecode-array-iterator.h" | 
| (...skipping 4141 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 4152   std::pair<const char*, Handle<Object>> tests[] = { | 4152   std::pair<const char*, Handle<Object>> tests[] = { | 
| 4153       {"function* f() { }; return f().next().value", | 4153       {"function* f() { }; return f().next().value", | 
| 4154        factory->undefined_value()}, | 4154        factory->undefined_value()}, | 
| 4155       {"function* f() { yield 42 }; return f().next().value", | 4155       {"function* f() { yield 42 }; return f().next().value", | 
| 4156        factory->NewNumberFromInt(42)}, | 4156        factory->NewNumberFromInt(42)}, | 
| 4157       {"function* f() { for (let x of [42]) yield x}; return f().next().value", | 4157       {"function* f() { for (let x of [42]) yield x}; return f().next().value", | 
| 4158        factory->NewNumberFromInt(42)}, | 4158        factory->NewNumberFromInt(42)}, | 
| 4159   }; | 4159   }; | 
| 4160 | 4160 | 
| 4161   for (size_t i = 0; i < arraysize(tests); i++) { | 4161   for (size_t i = 0; i < arraysize(tests); i++) { | 
| 4162     std::string source( | 4162     std::string source(InterpreterTester::SourceForBody(tests[i].first)); | 
| 4163         InterpreterTester::SourceForBody(tests[i].first)); |  | 
| 4164     InterpreterTester tester(handles.main_isolate(), source.c_str()); | 4163     InterpreterTester tester(handles.main_isolate(), source.c_str()); | 
| 4165     auto callable = tester.GetCallable<>(); | 4164     auto callable = tester.GetCallable<>(); | 
| 4166 | 4165 | 
| 4167     Handle<i::Object> return_value = callable().ToHandleChecked(); | 4166     Handle<i::Object> return_value = callable().ToHandleChecked(); | 
| 4168     CHECK(return_value->SameValue(*tests[i].second)); | 4167     CHECK(return_value->SameValue(*tests[i].second)); | 
| 4169   } | 4168   } | 
| 4170 | 4169 | 
| 4171   FLAG_ignition_generators = old_flag; | 4170   FLAG_ignition_generators = old_flag; | 
| 4172 } | 4171 } | 
| 4173 | 4172 | 
| 4174 |  | 
| 4175 }  // namespace interpreter | 4173 }  // namespace interpreter | 
| 4176 }  // namespace internal | 4174 }  // namespace internal | 
| 4177 }  // namespace v8 | 4175 }  // namespace v8 | 
| OLD | NEW | 
|---|