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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 } | 53 } |
54 | 54 |
55 | 55 |
56 function SetUpGenerators() { | 56 function SetUpGenerators() { |
57 %CheckIsBootstrapping(); | 57 %CheckIsBootstrapping(); |
58 var GeneratorObjectPrototype = GeneratorFunctionPrototype.prototype; | 58 var GeneratorObjectPrototype = GeneratorFunctionPrototype.prototype; |
59 InstallFunctions(GeneratorObjectPrototype, | 59 InstallFunctions(GeneratorObjectPrototype, |
60 DONT_ENUM | DONT_DELETE | READ_ONLY, | 60 DONT_ENUM | DONT_DELETE | READ_ONLY, |
61 ["next", GeneratorObjectNext, | 61 ["next", GeneratorObjectNext, |
62 "throw", GeneratorObjectThrow]); | 62 "throw", GeneratorObjectThrow]); |
| 63 %FunctionSetName(GeneratorObjectIterator, '[Symbol.iterator]'); |
63 %SetProperty(GeneratorObjectPrototype, symbolIterator, GeneratorObjectIterator
, | 64 %SetProperty(GeneratorObjectPrototype, symbolIterator, GeneratorObjectIterator
, |
64 DONT_ENUM | DONT_DELETE | READ_ONLY); | 65 DONT_ENUM | DONT_DELETE | READ_ONLY); |
65 %SetProperty(GeneratorObjectPrototype, "constructor", | 66 %SetProperty(GeneratorObjectPrototype, "constructor", |
66 GeneratorFunctionPrototype, DONT_ENUM | DONT_DELETE | READ_ONLY); | 67 GeneratorFunctionPrototype, DONT_ENUM | DONT_DELETE | READ_ONLY); |
67 %SetPrototype(GeneratorFunctionPrototype, $Function.prototype); | 68 %SetPrototype(GeneratorFunctionPrototype, $Function.prototype); |
68 %SetCode(GeneratorFunctionPrototype, GeneratorFunctionPrototypeConstructor); | 69 %SetCode(GeneratorFunctionPrototype, GeneratorFunctionPrototypeConstructor); |
69 %SetProperty(GeneratorFunctionPrototype, "constructor", | 70 %SetProperty(GeneratorFunctionPrototype, "constructor", |
70 GeneratorFunction, DONT_ENUM | DONT_DELETE | READ_ONLY); | 71 GeneratorFunction, DONT_ENUM | DONT_DELETE | READ_ONLY); |
71 %SetPrototype(GeneratorFunction, $Function); | 72 %SetPrototype(GeneratorFunction, $Function); |
72 %SetCode(GeneratorFunction, GeneratorFunctionConstructor); | 73 %SetCode(GeneratorFunction, GeneratorFunctionConstructor); |
73 } | 74 } |
74 | 75 |
75 SetUpGenerators(); | 76 SetUpGenerators(); |
OLD | NEW |