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

Side by Side Diff: src/string-iterator.js

Issue 384003003: Replace AddProperty by AddNamedProperty to speed up the common case (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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/string.js ('k') | src/symbol.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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 7
8 // This file relies on the fact that the following declaration has been made 8 // This file relies on the fact that the following declaration has been made
9 // in runtime.js: 9 // in runtime.js:
10 // var $String = global.String; 10 // var $String = global.String;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 function SetUpStringIterator() { 77 function SetUpStringIterator() {
78 %CheckIsBootstrapping(); 78 %CheckIsBootstrapping();
79 79
80 %FunctionSetPrototype(StringIterator, new $Object()); 80 %FunctionSetPrototype(StringIterator, new $Object());
81 %FunctionSetInstanceClassName(StringIterator, 'String Iterator'); 81 %FunctionSetInstanceClassName(StringIterator, 'String Iterator');
82 82
83 InstallFunctions(StringIterator.prototype, DONT_ENUM, $Array( 83 InstallFunctions(StringIterator.prototype, DONT_ENUM, $Array(
84 'next', StringIteratorNext 84 'next', StringIteratorNext
85 )); 85 ));
86 %FunctionSetName(StringIteratorIterator, '[Symbol.iterator]'); 86 %FunctionSetName(StringIteratorIterator, '[Symbol.iterator]');
87 %AddProperty(StringIterator.prototype, symbolIterator, StringIteratorIterator, 87 %AddNamedProperty(StringIterator.prototype, symbolIterator,
88 DONT_ENUM); 88 StringIteratorIterator, DONT_ENUM);
89 } 89 }
90 SetUpStringIterator(); 90 SetUpStringIterator();
91 91
92 92
93 // 21.1.3.27 String.prototype [ @@iterator ]( ) 93 // 21.1.3.27 String.prototype [ @@iterator ]( )
94 function StringPrototypeIterator() { 94 function StringPrototypeIterator() {
95 return CreateStringIterator(this); 95 return CreateStringIterator(this);
96 } 96 }
97 97
98 98
99 function ExtendStringPrototypeWithIterator() { 99 function ExtendStringPrototypeWithIterator() {
100 %CheckIsBootstrapping(); 100 %CheckIsBootstrapping();
101 101
102 %FunctionSetName(StringPrototypeIterator, '[Symbol.iterator]'); 102 %FunctionSetName(StringPrototypeIterator, '[Symbol.iterator]');
103 %AddProperty($String.prototype, symbolIterator, StringPrototypeIterator, 103 %AddNamedProperty($String.prototype, symbolIterator,
104 DONT_ENUM); 104 StringPrototypeIterator, DONT_ENUM);
105 } 105 }
106 ExtendStringPrototypeWithIterator(); 106 ExtendStringPrototypeWithIterator();
OLDNEW
« no previous file with comments | « src/string.js ('k') | src/symbol.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698