OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/base/ieee754.h" | 9 #include "src/base/ieee754.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); | 689 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); |
690 | 690 |
691 JSObject::AddProperty(generator_object_prototype, | 691 JSObject::AddProperty(generator_object_prototype, |
692 factory()->constructor_string(), | 692 factory()->constructor_string(), |
693 generator_function_prototype, | 693 generator_function_prototype, |
694 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); | 694 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); |
695 JSObject::AddProperty(generator_object_prototype, | 695 JSObject::AddProperty(generator_object_prototype, |
696 factory()->to_string_tag_symbol(), | 696 factory()->to_string_tag_symbol(), |
697 factory()->NewStringFromAsciiChecked("Generator"), | 697 factory()->NewStringFromAsciiChecked("Generator"), |
698 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); | 698 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); |
699 SimpleInstallFunction(generator_object_prototype, "next", | 699 Handle<JSFunction> next = |
700 Builtins::kGeneratorPrototypeNext, 1, true); | 700 SimpleInstallFunction(generator_object_prototype, "next", |
| 701 Builtins::kGeneratorPrototypeNext, 1, true); |
| 702 native_context()->set_generator_prototype_next(*next); |
701 SimpleInstallFunction(generator_object_prototype, "return", | 703 SimpleInstallFunction(generator_object_prototype, "return", |
702 Builtins::kGeneratorPrototypeReturn, 1, true); | 704 Builtins::kGeneratorPrototypeReturn, 1, true); |
703 SimpleInstallFunction(generator_object_prototype, "throw", | 705 SimpleInstallFunction(generator_object_prototype, "throw", |
704 Builtins::kGeneratorPrototypeThrow, 1, true); | 706 Builtins::kGeneratorPrototypeThrow, 1, true); |
705 | 707 |
706 // Create maps for generator functions and their prototypes. Store those | 708 // Create maps for generator functions and their prototypes. Store those |
707 // maps in the native context. The "prototype" property descriptor is | 709 // maps in the native context. The "prototype" property descriptor is |
708 // writable, non-enumerable, and non-configurable (as per ES6 draft | 710 // writable, non-enumerable, and non-configurable (as per ES6 draft |
709 // 04-14-15, section 25.2.4.3). | 711 // 04-14-15, section 25.2.4.3). |
710 Handle<Map> strict_function_map(strict_function_map_writable_prototype_); | 712 Handle<Map> strict_function_map(strict_function_map_writable_prototype_); |
(...skipping 3481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4192 } | 4194 } |
4193 | 4195 |
4194 | 4196 |
4195 // Called when the top-level V8 mutex is destroyed. | 4197 // Called when the top-level V8 mutex is destroyed. |
4196 void Bootstrapper::FreeThreadResources() { | 4198 void Bootstrapper::FreeThreadResources() { |
4197 DCHECK(!IsActive()); | 4199 DCHECK(!IsActive()); |
4198 } | 4200 } |
4199 | 4201 |
4200 } // namespace internal | 4202 } // namespace internal |
4201 } // namespace v8 | 4203 } // namespace v8 |
OLD | NEW |