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

Side by Side Diff: src/generator.js

Issue 764823002: Set @@toStringTag on GeneratorFunction prototype. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years 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
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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 | DONT_DELETE | 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,
105 symbolToStringTag, "GeneratorFunction", DONT_ENUM | READ_ONLY);
104 %SetCode(GeneratorFunctionPrototype, GeneratorFunctionPrototypeConstructor); 106 %SetCode(GeneratorFunctionPrototype, GeneratorFunctionPrototypeConstructor);
105 %AddNamedProperty(GeneratorFunctionPrototype, "constructor", 107 %AddNamedProperty(GeneratorFunctionPrototype, "constructor",
106 GeneratorFunction, DONT_ENUM | DONT_DELETE | READ_ONLY); 108 GeneratorFunction, DONT_ENUM | DONT_DELETE | READ_ONLY);
107 %InternalSetPrototype(GeneratorFunction, $Function); 109 %InternalSetPrototype(GeneratorFunction, $Function);
108 %SetCode(GeneratorFunction, GeneratorFunctionConstructor); 110 %SetCode(GeneratorFunction, GeneratorFunctionConstructor);
109 } 111 }
110 112
111 SetUpGenerators(); 113 SetUpGenerators();
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es6/generators-objects.js » ('j') | test/mjsunit/es6/generators-objects.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698