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

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

Issue 1323543002: [runtime] Replace %to_string_fun with %_ToString. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@ToStringStub
Patch Set: REBASE. Fixes Created 5 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
« 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 (function(global, utils) { 5 (function(global, utils) {
6 6
7 "use strict"; 7 "use strict";
8 8
9 %CheckIsBootstrapping(); 9 %CheckIsBootstrapping();
10 10
11 // ------------------------------------------------------------------- 11 // -------------------------------------------------------------------
12 // Imports 12 // Imports
13 13
14 var GlobalString = global.String; 14 var GlobalString = global.String;
15 var iteratorSymbol = utils.ImportNow("iterator_symbol"); 15 var iteratorSymbol = utils.ImportNow("iterator_symbol");
16 var stringIteratorIteratedStringSymbol = 16 var stringIteratorIteratedStringSymbol =
17 utils.ImportNow("string_iterator_iterated_string_symbol"); 17 utils.ImportNow("string_iterator_iterated_string_symbol");
18 var stringIteratorNextIndexSymbol = 18 var stringIteratorNextIndexSymbol =
19 utils.ImportNow("string_iterator_next_index_symbol"); 19 utils.ImportNow("string_iterator_next_index_symbol");
20 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol"); 20 var toStringTagSymbol = utils.ImportNow("to_string_tag_symbol");
21 21
22 // ------------------------------------------------------------------- 22 // -------------------------------------------------------------------
23 23
24 function StringIterator() {} 24 function StringIterator() {}
25 25
26 26
27 // 21.1.5.1 CreateStringIterator Abstract Operation 27 // 21.1.5.1 CreateStringIterator Abstract Operation
28 function CreateStringIterator(string) { 28 function CreateStringIterator(string) {
29 var s = TO_STRING_INLINE(string); 29 var s = TO_STRING(string);
30 var iterator = new StringIterator; 30 var iterator = new StringIterator;
31 SET_PRIVATE(iterator, stringIteratorIteratedStringSymbol, s); 31 SET_PRIVATE(iterator, stringIteratorIteratedStringSymbol, s);
32 SET_PRIVATE(iterator, stringIteratorNextIndexSymbol, 0); 32 SET_PRIVATE(iterator, stringIteratorNextIndexSymbol, 0);
33 return iterator; 33 return iterator;
34 } 34 }
35 35
36 36
37 // ES6 section 21.1.5.2.1 %StringIteratorPrototype%.next ( ) 37 // ES6 section 21.1.5.2.1 %StringIteratorPrototype%.next ( )
38 function StringIteratorNext() { 38 function StringIteratorNext() {
39 var iterator = this; 39 var iterator = this;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 'next', StringIteratorNext 87 'next', StringIteratorNext
88 ]); 88 ]);
89 %AddNamedProperty(StringIterator.prototype, toStringTagSymbol, 89 %AddNamedProperty(StringIterator.prototype, toStringTagSymbol,
90 "String Iterator", READ_ONLY | DONT_ENUM); 90 "String Iterator", READ_ONLY | DONT_ENUM);
91 91
92 utils.SetFunctionName(StringPrototypeIterator, iteratorSymbol); 92 utils.SetFunctionName(StringPrototypeIterator, iteratorSymbol);
93 %AddNamedProperty(GlobalString.prototype, iteratorSymbol, 93 %AddNamedProperty(GlobalString.prototype, iteratorSymbol,
94 StringPrototypeIterator, DONT_ENUM); 94 StringPrototypeIterator, DONT_ENUM);
95 95
96 }) 96 })
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