Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Side by Side Diff: src/generator.js

Issue 1051363003: Correct property descriptors on GeneratorPrototype (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/es6/generators-runtime.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 %CheckIsBootstrapping(); 82 %CheckIsBootstrapping();
83 83
84 // Both Runtime_GeneratorNext and Runtime_GeneratorThrow are supported by 84 // Both Runtime_GeneratorNext and Runtime_GeneratorThrow are supported by
85 // neither Crankshaft nor TurboFan, disable optimization of wrappers here. 85 // neither Crankshaft nor TurboFan, disable optimization of wrappers here.
86 %NeverOptimizeFunction(GeneratorObjectNext); 86 %NeverOptimizeFunction(GeneratorObjectNext);
87 %NeverOptimizeFunction(GeneratorObjectThrow); 87 %NeverOptimizeFunction(GeneratorObjectThrow);
88 88
89 // Set up non-enumerable functions on the generator prototype object. 89 // Set up non-enumerable functions on the generator prototype object.
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,
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 | 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 | 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();
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es6/generators-runtime.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698