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

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

Issue 486763002: Make all global private symbols own symbols. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: HAS_DEFINED_PRIVATE is back Created 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/macros.py » ('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 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 $Array = global.Array; 10 // var $Array = global.Array;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 // 22.1.5.2.2 %ArrayIteratorPrototype%[@@iterator] 43 // 22.1.5.2.2 %ArrayIteratorPrototype%[@@iterator]
44 function ArrayIteratorIterator() { 44 function ArrayIteratorIterator() {
45 return this; 45 return this;
46 } 46 }
47 47
48 48
49 // 15.4.5.2.2 ArrayIterator.prototype.next( ) 49 // 15.4.5.2.2 ArrayIterator.prototype.next( )
50 function ArrayIteratorNext() { 50 function ArrayIteratorNext() {
51 var iterator = ToObject(this); 51 var iterator = ToObject(this);
52 52
53 if (!HAS_PRIVATE(iterator, arrayIteratorObjectSymbol)) { 53 if (!HAS_DEFINED_PRIVATE(iterator, arrayIteratorNextIndexSymbol)) {
54 throw MakeTypeError('incompatible_method_receiver', 54 throw MakeTypeError('incompatible_method_receiver',
55 ['Array Iterator.prototype.next']); 55 ['Array Iterator.prototype.next']);
56 } 56 }
57 57
58 var array = GET_PRIVATE(iterator, arrayIteratorObjectSymbol); 58 var array = GET_PRIVATE(iterator, arrayIteratorObjectSymbol);
59 if (IS_UNDEFINED(array)) { 59 if (IS_UNDEFINED(array)) {
60 return CreateIteratorResultObject(UNDEFINED, true); 60 return CreateIteratorResultObject(UNDEFINED, true);
61 } 61 }
62 62
63 var index = GET_PRIVATE(iterator, arrayIteratorNextIndexSymbol); 63 var index = GET_PRIVATE(iterator, arrayIteratorNextIndexSymbol);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 macro EXTEND_TYPED_ARRAY(NAME) 148 macro EXTEND_TYPED_ARRAY(NAME)
149 %AddNamedProperty($NAME.prototype, 'entries', ArrayEntries, DONT_ENUM); 149 %AddNamedProperty($NAME.prototype, 'entries', ArrayEntries, DONT_ENUM);
150 %AddNamedProperty($NAME.prototype, 'values', ArrayValues, DONT_ENUM); 150 %AddNamedProperty($NAME.prototype, 'values', ArrayValues, DONT_ENUM);
151 %AddNamedProperty($NAME.prototype, 'keys', ArrayKeys, DONT_ENUM); 151 %AddNamedProperty($NAME.prototype, 'keys', ArrayKeys, DONT_ENUM);
152 %AddNamedProperty($NAME.prototype, symbolIterator, ArrayValues, DONT_ENUM); 152 %AddNamedProperty($NAME.prototype, symbolIterator, ArrayValues, DONT_ENUM);
153 endmacro 153 endmacro
154 154
155 TYPED_ARRAYS(EXTEND_TYPED_ARRAY) 155 TYPED_ARRAYS(EXTEND_TYPED_ARRAY)
156 } 156 }
157 ExtendTypedArrayPrototypes(); 157 ExtendTypedArrayPrototypes();
OLDNEW
« no previous file with comments | « no previous file | src/macros.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698