| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 42     throw MakeTypeError('not_constructor', ['GeneratorFunctionPrototype']); | 42     throw MakeTypeError('not_constructor', ['GeneratorFunctionPrototype']); | 
| 43   } | 43   } | 
| 44 } | 44 } | 
| 45 | 45 | 
| 46 function GeneratorFunctionConstructor(arg1) {  // length == 1 | 46 function GeneratorFunctionConstructor(arg1) {  // length == 1 | 
| 47   var source = NewFunctionString(arguments, 'function*'); | 47   var source = NewFunctionString(arguments, 'function*'); | 
| 48   var global_proxy = %GlobalProxy(global); | 48   var global_proxy = %GlobalProxy(global); | 
| 49   // Compile the string in the constructor and not a helper so that errors | 49   // Compile the string in the constructor and not a helper so that errors | 
| 50   // appear to come from here. | 50   // appear to come from here. | 
| 51   var f = %_CallFunction(global_proxy, %CompileString(source, true)); | 51   var f = %_CallFunction(global_proxy, %CompileString(source, true)); | 
| 52   %FunctionMarkNameShouldPrintAsAnonymous(f); |  | 
| 53   return f; | 52   return f; | 
| 54 } | 53 } | 
| 55 | 54 | 
| 56 | 55 | 
| 57 function SetUpGenerators() { | 56 function SetUpGenerators() { | 
| 58   %CheckIsBootstrapping(); | 57   %CheckIsBootstrapping(); | 
| 59 | 58 | 
| 60   // Both Runtime_GeneratorNext and Runtime_GeneratorThrow are supported by | 59   // Both Runtime_GeneratorNext and Runtime_GeneratorThrow are supported by | 
| 61   // neither Crankshaft nor TurboFan, disable optimization of wrappers here. | 60   // neither Crankshaft nor TurboFan, disable optimization of wrappers here. | 
| 62   %NeverOptimizeFunction(GeneratorObjectNext); | 61   %NeverOptimizeFunction(GeneratorObjectNext); | 
| (...skipping 15 matching lines...) Expand all  Loading... | 
| 78       symbolToStringTag, "Generator", DONT_ENUM | READ_ONLY); | 77       symbolToStringTag, "Generator", DONT_ENUM | READ_ONLY); | 
| 79   %InternalSetPrototype(GeneratorFunctionPrototype, $Function.prototype); | 78   %InternalSetPrototype(GeneratorFunctionPrototype, $Function.prototype); | 
| 80   %SetCode(GeneratorFunctionPrototype, GeneratorFunctionPrototypeConstructor); | 79   %SetCode(GeneratorFunctionPrototype, GeneratorFunctionPrototypeConstructor); | 
| 81   %AddNamedProperty(GeneratorFunctionPrototype, "constructor", | 80   %AddNamedProperty(GeneratorFunctionPrototype, "constructor", | 
| 82       GeneratorFunction, DONT_ENUM | DONT_DELETE | READ_ONLY); | 81       GeneratorFunction, DONT_ENUM | DONT_DELETE | READ_ONLY); | 
| 83   %InternalSetPrototype(GeneratorFunction, $Function); | 82   %InternalSetPrototype(GeneratorFunction, $Function); | 
| 84   %SetCode(GeneratorFunction, GeneratorFunctionConstructor); | 83   %SetCode(GeneratorFunction, GeneratorFunctionConstructor); | 
| 85 } | 84 } | 
| 86 | 85 | 
| 87 SetUpGenerators(); | 86 SetUpGenerators(); | 
| OLD | NEW | 
|---|