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

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

Issue 1531843003: Rename IS_SPEC_OBJECT macro to IS_RECEIVER. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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/js/regexp.js ('k') | src/js/v8natives.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 28 matching lines...) Expand all
39 return iterator; 39 return iterator;
40 } 40 }
41 41
42 42
43 // ES6 section 21.1.5.2.1 %StringIteratorPrototype%.next ( ) 43 // ES6 section 21.1.5.2.1 %StringIteratorPrototype%.next ( )
44 function StringIteratorNext() { 44 function StringIteratorNext() {
45 var iterator = this; 45 var iterator = this;
46 var value = UNDEFINED; 46 var value = UNDEFINED;
47 var done = true; 47 var done = true;
48 48
49 if (!IS_SPEC_OBJECT(iterator) || 49 if (!IS_RECEIVER(iterator) ||
50 !HAS_DEFINED_PRIVATE(iterator, stringIteratorNextIndexSymbol)) { 50 !HAS_DEFINED_PRIVATE(iterator, stringIteratorNextIndexSymbol)) {
51 throw MakeTypeError(kIncompatibleMethodReceiver, 51 throw MakeTypeError(kIncompatibleMethodReceiver,
52 'String Iterator.prototype.next'); 52 'String Iterator.prototype.next');
53 } 53 }
54 54
55 var s = GET_PRIVATE(iterator, stringIteratorIteratedStringSymbol); 55 var s = GET_PRIVATE(iterator, stringIteratorIteratedStringSymbol);
56 if (!IS_UNDEFINED(s)) { 56 if (!IS_UNDEFINED(s)) {
57 var position = GET_PRIVATE(iterator, stringIteratorNextIndexSymbol); 57 var position = GET_PRIVATE(iterator, stringIteratorNextIndexSymbol);
58 var length = TO_UINT32(s.length); 58 var length = TO_UINT32(s.length);
59 if (position >= length) { 59 if (position >= length) {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 'next', StringIteratorNext 93 'next', StringIteratorNext
94 ]); 94 ]);
95 %AddNamedProperty(StringIterator.prototype, toStringTagSymbol, 95 %AddNamedProperty(StringIterator.prototype, toStringTagSymbol,
96 "String Iterator", READ_ONLY | DONT_ENUM); 96 "String Iterator", READ_ONLY | DONT_ENUM);
97 97
98 utils.SetFunctionName(StringPrototypeIterator, iteratorSymbol); 98 utils.SetFunctionName(StringPrototypeIterator, iteratorSymbol);
99 %AddNamedProperty(GlobalString.prototype, iteratorSymbol, 99 %AddNamedProperty(GlobalString.prototype, iteratorSymbol,
100 StringPrototypeIterator, DONT_ENUM); 100 StringPrototypeIterator, DONT_ENUM);
101 101
102 }) 102 })
OLDNEW
« no previous file with comments | « src/js/regexp.js ('k') | src/js/v8natives.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698