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