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

Side by Side Diff: src/generator.js

Issue 546803003: Update ObjectToString to Harmony-draft algorithm (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Use intern'd strings instead of creating vectors Created 6 years, 2 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 | Annotate | Revision Log
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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // neither Crankshaft nor TurboFan, disable optimization of wrappers here. 61 // neither Crankshaft nor TurboFan, disable optimization of wrappers here.
62 %NeverOptimizeFunction(GeneratorObjectNext); 62 %NeverOptimizeFunction(GeneratorObjectNext);
63 %NeverOptimizeFunction(GeneratorObjectThrow); 63 %NeverOptimizeFunction(GeneratorObjectThrow);
64 64
65 // Set up non-enumerable functions on the generator prototype object. 65 // Set up non-enumerable functions on the generator prototype object.
66 var GeneratorObjectPrototype = GeneratorFunctionPrototype.prototype; 66 var GeneratorObjectPrototype = GeneratorFunctionPrototype.prototype;
67 InstallFunctions(GeneratorObjectPrototype, 67 InstallFunctions(GeneratorObjectPrototype,
68 DONT_ENUM | DONT_DELETE | READ_ONLY, 68 DONT_ENUM | DONT_DELETE | READ_ONLY,
69 ["next", GeneratorObjectNext, 69 ["next", GeneratorObjectNext,
70 "throw", GeneratorObjectThrow]); 70 "throw", GeneratorObjectThrow]);
71
Dmitry Lomov (no reviews) 2014/10/18 15:16:48 Nit: keep this empty line.
72 %FunctionSetName(GeneratorObjectIterator, '[Symbol.iterator]'); 71 %FunctionSetName(GeneratorObjectIterator, '[Symbol.iterator]');
73 %AddNamedProperty(GeneratorObjectPrototype, symbolIterator, 72 %AddNamedProperty(GeneratorObjectPrototype, symbolIterator,
74 GeneratorObjectIterator, DONT_ENUM | DONT_DELETE | READ_ONLY); 73 GeneratorObjectIterator, DONT_ENUM | DONT_DELETE | READ_ONLY);
75 %AddNamedProperty(GeneratorObjectPrototype, "constructor", 74 %AddNamedProperty(GeneratorObjectPrototype, "constructor",
76 GeneratorFunctionPrototype, DONT_ENUM | DONT_DELETE | READ_ONLY); 75 GeneratorFunctionPrototype, DONT_ENUM | DONT_DELETE | READ_ONLY);
76 %AddNamedProperty(GeneratorObjectPrototype,
77 symbolToStringTag, "Generator", DONT_ENUM | READ_ONLY);
77 %InternalSetPrototype(GeneratorFunctionPrototype, $Function.prototype); 78 %InternalSetPrototype(GeneratorFunctionPrototype, $Function.prototype);
78 %SetCode(GeneratorFunctionPrototype, GeneratorFunctionPrototypeConstructor); 79 %SetCode(GeneratorFunctionPrototype, GeneratorFunctionPrototypeConstructor);
79 %AddNamedProperty(GeneratorFunctionPrototype, "constructor", 80 %AddNamedProperty(GeneratorFunctionPrototype, "constructor",
80 GeneratorFunction, DONT_ENUM | DONT_DELETE | READ_ONLY); 81 GeneratorFunction, DONT_ENUM | DONT_DELETE | READ_ONLY);
81 %InternalSetPrototype(GeneratorFunction, $Function); 82 %InternalSetPrototype(GeneratorFunction, $Function);
82 %SetCode(GeneratorFunction, GeneratorFunctionConstructor); 83 %SetCode(GeneratorFunction, GeneratorFunctionConstructor);
83 } 84 }
84 85
85 SetUpGenerators(); 86 SetUpGenerators();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698