OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 (function(global, utils) { | 5 (function(global, utils) { |
6 | 6 |
7 "use strict"; | 7 "use strict"; |
8 | 8 |
9 %CheckIsBootstrapping(); | 9 %CheckIsBootstrapping(); |
10 | 10 |
11 // ------------------------------------------------------------------- | 11 // ------------------------------------------------------------------- |
12 // Imports | 12 // Imports |
13 | 13 |
14 var GlobalFunction = global.Function; | 14 var GlobalFunction = global.Function; |
15 | |
16 var NewFunctionString; | 15 var NewFunctionString; |
| 16 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); |
17 | 17 |
18 utils.Import(function(from) { | 18 utils.Import(function(from) { |
19 NewFunctionString = from.NewFunctionString; | 19 NewFunctionString = from.NewFunctionString; |
20 }); | 20 }); |
21 | 21 |
22 // ---------------------------------------------------------------------------- | 22 // ---------------------------------------------------------------------------- |
23 | 23 |
24 // Generator functions and objects are specified by ES6, sections 15.19.3 and | 24 // Generator functions and objects are specified by ES6, sections 15.19.3 and |
25 // 15.19.4. | 25 // 15.19.4. |
26 | 26 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // Set up non-enumerable functions on the generator prototype object. | 95 // Set up non-enumerable functions on the generator prototype object. |
96 var GeneratorObjectPrototype = GeneratorFunctionPrototype.prototype; | 96 var GeneratorObjectPrototype = GeneratorFunctionPrototype.prototype; |
97 utils.InstallFunctions(GeneratorObjectPrototype, | 97 utils.InstallFunctions(GeneratorObjectPrototype, |
98 DONT_ENUM, | 98 DONT_ENUM, |
99 ["next", GeneratorObjectNext, | 99 ["next", GeneratorObjectNext, |
100 "throw", GeneratorObjectThrow]); | 100 "throw", GeneratorObjectThrow]); |
101 | 101 |
102 %AddNamedProperty(GeneratorObjectPrototype, "constructor", | 102 %AddNamedProperty(GeneratorObjectPrototype, "constructor", |
103 GeneratorFunctionPrototype, DONT_ENUM | READ_ONLY); | 103 GeneratorFunctionPrototype, DONT_ENUM | READ_ONLY); |
104 %AddNamedProperty(GeneratorObjectPrototype, | 104 %AddNamedProperty(GeneratorObjectPrototype, |
105 symbolToStringTag, "Generator", DONT_ENUM | READ_ONLY); | 105 toStringTagSymbol, "Generator", DONT_ENUM | READ_ONLY); |
106 %InternalSetPrototype(GeneratorFunctionPrototype, GlobalFunction.prototype); | 106 %InternalSetPrototype(GeneratorFunctionPrototype, GlobalFunction.prototype); |
107 %AddNamedProperty(GeneratorFunctionPrototype, | 107 %AddNamedProperty(GeneratorFunctionPrototype, |
108 symbolToStringTag, "GeneratorFunction", DONT_ENUM | READ_ONLY); | 108 toStringTagSymbol, "GeneratorFunction", DONT_ENUM | READ_ONLY); |
109 %AddNamedProperty(GeneratorFunctionPrototype, "constructor", | 109 %AddNamedProperty(GeneratorFunctionPrototype, "constructor", |
110 GeneratorFunction, DONT_ENUM | READ_ONLY); | 110 GeneratorFunction, DONT_ENUM | READ_ONLY); |
111 %InternalSetPrototype(GeneratorFunction, GlobalFunction); | 111 %InternalSetPrototype(GeneratorFunction, GlobalFunction); |
112 %SetCode(GeneratorFunction, GeneratorFunctionConstructor); | 112 %SetCode(GeneratorFunction, GeneratorFunctionConstructor); |
113 | 113 |
114 }) | 114 }) |
OLD | NEW |