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 "use strict"; | 5 "use strict"; |
6 | 6 |
7 // This file relies on the fact that the following declarations have been made | 7 // This file relies on the fact that the following declarations have been made |
8 // in runtime.js: | 8 // in runtime.js: |
9 // var $Function = global.Function; | 9 // var $Function = global.Function; |
10 | 10 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 var GeneratorObjectPrototype = GeneratorFunctionPrototype.prototype; | 90 var GeneratorObjectPrototype = GeneratorFunctionPrototype.prototype; |
91 InstallFunctions(GeneratorObjectPrototype, | 91 InstallFunctions(GeneratorObjectPrototype, |
92 DONT_ENUM | DONT_DELETE | READ_ONLY, | 92 DONT_ENUM | DONT_DELETE | READ_ONLY, |
93 ["next", GeneratorObjectNext, | 93 ["next", GeneratorObjectNext, |
94 "throw", GeneratorObjectThrow]); | 94 "throw", GeneratorObjectThrow]); |
95 | 95 |
96 %FunctionSetName(GeneratorObjectIterator, '[Symbol.iterator]'); | 96 %FunctionSetName(GeneratorObjectIterator, '[Symbol.iterator]'); |
97 %AddNamedProperty(GeneratorObjectPrototype, symbolIterator, | 97 %AddNamedProperty(GeneratorObjectPrototype, symbolIterator, |
98 GeneratorObjectIterator, DONT_ENUM | DONT_DELETE | READ_ONLY); | 98 GeneratorObjectIterator, DONT_ENUM | DONT_DELETE | READ_ONLY); |
99 %AddNamedProperty(GeneratorObjectPrototype, "constructor", | 99 %AddNamedProperty(GeneratorObjectPrototype, "constructor", |
100 GeneratorFunctionPrototype, DONT_ENUM | DONT_DELETE | READ_ONLY); | 100 GeneratorFunctionPrototype, DONT_ENUM | READ_ONLY); |
101 %AddNamedProperty(GeneratorObjectPrototype, | 101 %AddNamedProperty(GeneratorObjectPrototype, |
102 symbolToStringTag, "Generator", DONT_ENUM | READ_ONLY); | 102 symbolToStringTag, "Generator", DONT_ENUM | READ_ONLY); |
103 %InternalSetPrototype(GeneratorFunctionPrototype, $Function.prototype); | 103 %InternalSetPrototype(GeneratorFunctionPrototype, $Function.prototype); |
104 %AddNamedProperty(GeneratorFunctionPrototype, | 104 %AddNamedProperty(GeneratorFunctionPrototype, |
105 symbolToStringTag, "GeneratorFunction", DONT_ENUM | READ_ONLY); | 105 symbolToStringTag, "GeneratorFunction", DONT_ENUM | READ_ONLY); |
106 %SetCode(GeneratorFunctionPrototype, GeneratorFunctionPrototypeConstructor); | 106 %SetCode(GeneratorFunctionPrototype, GeneratorFunctionPrototypeConstructor); |
107 %AddNamedProperty(GeneratorFunctionPrototype, "constructor", | 107 %AddNamedProperty(GeneratorFunctionPrototype, "constructor", |
108 GeneratorFunction, DONT_ENUM | DONT_DELETE | READ_ONLY); | 108 GeneratorFunction, DONT_ENUM | READ_ONLY); |
109 %InternalSetPrototype(GeneratorFunction, $Function); | 109 %InternalSetPrototype(GeneratorFunction, $Function); |
110 %SetCode(GeneratorFunction, GeneratorFunctionConstructor); | 110 %SetCode(GeneratorFunction, GeneratorFunctionConstructor); |
111 } | 111 } |
112 | 112 |
113 SetUpGenerators(); | 113 SetUpGenerators(); |
OLD | NEW |