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

Side by Side Diff: src/generator.js

Issue 332663004: For-of calls [Symbol.iterator]() on RHS to get iterator (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 6 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
« no previous file with comments | « src/flag-definitions.h ('k') | src/heap.h » ('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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 } 53 }
54 54
55 55
56 function SetUpGenerators() { 56 function SetUpGenerators() {
57 %CheckIsBootstrapping(); 57 %CheckIsBootstrapping();
58 var GeneratorObjectPrototype = GeneratorFunctionPrototype.prototype; 58 var GeneratorObjectPrototype = GeneratorFunctionPrototype.prototype;
59 InstallFunctions(GeneratorObjectPrototype, 59 InstallFunctions(GeneratorObjectPrototype,
60 DONT_ENUM | DONT_DELETE | READ_ONLY, 60 DONT_ENUM | DONT_DELETE | READ_ONLY,
61 ["next", GeneratorObjectNext, 61 ["next", GeneratorObjectNext,
62 "throw", GeneratorObjectThrow]); 62 "throw", GeneratorObjectThrow]);
63 %FunctionSetName(GeneratorObjectIterator, '[Symbol.iterator]');
63 %SetProperty(GeneratorObjectPrototype, symbolIterator, GeneratorObjectIterator , 64 %SetProperty(GeneratorObjectPrototype, symbolIterator, GeneratorObjectIterator ,
64 DONT_ENUM | DONT_DELETE | READ_ONLY); 65 DONT_ENUM | DONT_DELETE | READ_ONLY);
65 %SetProperty(GeneratorObjectPrototype, "constructor", 66 %SetProperty(GeneratorObjectPrototype, "constructor",
66 GeneratorFunctionPrototype, DONT_ENUM | DONT_DELETE | READ_ONLY); 67 GeneratorFunctionPrototype, DONT_ENUM | DONT_DELETE | READ_ONLY);
67 %SetPrototype(GeneratorFunctionPrototype, $Function.prototype); 68 %SetPrototype(GeneratorFunctionPrototype, $Function.prototype);
68 %SetCode(GeneratorFunctionPrototype, GeneratorFunctionPrototypeConstructor); 69 %SetCode(GeneratorFunctionPrototype, GeneratorFunctionPrototypeConstructor);
69 %SetProperty(GeneratorFunctionPrototype, "constructor", 70 %SetProperty(GeneratorFunctionPrototype, "constructor",
70 GeneratorFunction, DONT_ENUM | DONT_DELETE | READ_ONLY); 71 GeneratorFunction, DONT_ENUM | DONT_DELETE | READ_ONLY);
71 %SetPrototype(GeneratorFunction, $Function); 72 %SetPrototype(GeneratorFunction, $Function);
72 %SetCode(GeneratorFunction, GeneratorFunctionConstructor); 73 %SetCode(GeneratorFunction, GeneratorFunctionConstructor);
73 } 74 }
74 75
75 SetUpGenerators(); 76 SetUpGenerators();
OLDNEW
« no previous file with comments | « src/flag-definitions.h ('k') | src/heap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698