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

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

Issue 1266013006: [stubs] Unify (and optimize) implementation of ToObject. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add missing support for %_ToObject in TurboFan and Crankshaft. Created 5 years, 4 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
(...skipping 23 matching lines...) Expand all
34 var s = TO_STRING_INLINE(string); 34 var s = TO_STRING_INLINE(string);
35 var iterator = new StringIterator; 35 var iterator = new StringIterator;
36 SET_PRIVATE(iterator, stringIteratorIteratedStringSymbol, s); 36 SET_PRIVATE(iterator, stringIteratorIteratedStringSymbol, s);
37 SET_PRIVATE(iterator, stringIteratorNextIndexSymbol, 0); 37 SET_PRIVATE(iterator, stringIteratorNextIndexSymbol, 0);
38 return iterator; 38 return iterator;
39 } 39 }
40 40
41 41
42 // 21.1.5.2.1 %StringIteratorPrototype%.next( ) 42 // 21.1.5.2.1 %StringIteratorPrototype%.next( )
43 function StringIteratorNext() { 43 function StringIteratorNext() {
44 var iterator = $toObject(this); 44 var iterator = TO_OBJECT(this);
45 45
46 if (!HAS_DEFINED_PRIVATE(iterator, stringIteratorNextIndexSymbol)) { 46 if (!HAS_DEFINED_PRIVATE(iterator, stringIteratorNextIndexSymbol)) {
47 throw MakeTypeError(kIncompatibleMethodReceiver, 47 throw MakeTypeError(kIncompatibleMethodReceiver,
48 'String Iterator.prototype.next'); 48 'String Iterator.prototype.next');
49 } 49 }
50 50
51 var s = GET_PRIVATE(iterator, stringIteratorIteratedStringSymbol); 51 var s = GET_PRIVATE(iterator, stringIteratorIteratedStringSymbol);
52 if (IS_UNDEFINED(s)) { 52 if (IS_UNDEFINED(s)) {
53 return ArrayIteratorCreateResultObject(UNDEFINED, true); 53 return ArrayIteratorCreateResultObject(UNDEFINED, true);
54 } 54 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 'next', StringIteratorNext 94 'next', StringIteratorNext
95 ]); 95 ]);
96 %AddNamedProperty(StringIterator.prototype, symbolToStringTag, 96 %AddNamedProperty(StringIterator.prototype, symbolToStringTag,
97 "String Iterator", READ_ONLY | DONT_ENUM); 97 "String Iterator", READ_ONLY | DONT_ENUM);
98 98
99 utils.SetFunctionName(StringPrototypeIterator, symbolIterator); 99 utils.SetFunctionName(StringPrototypeIterator, symbolIterator);
100 %AddNamedProperty(GlobalString.prototype, symbolIterator, 100 %AddNamedProperty(GlobalString.prototype, symbolIterator,
101 StringPrototypeIterator, DONT_ENUM); 101 StringPrototypeIterator, DONT_ENUM);
102 102
103 }) 103 })
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