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

Side by Side Diff: src/weak-collection.js

Issue 1325573004: [runtime] Replace many buggy uses of %_CallFunction with %_Call. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Address feedback. Created 5 years, 3 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/typedarray.js ('k') | src/x64/interface-descriptors-x64.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 14 matching lines...) Expand all
25 25
26 if (!IS_NULL_OR_UNDEFINED(iterable)) { 26 if (!IS_NULL_OR_UNDEFINED(iterable)) {
27 var adder = this.set; 27 var adder = this.set;
28 if (!IS_CALLABLE(adder)) { 28 if (!IS_CALLABLE(adder)) {
29 throw MakeTypeError(kPropertyNotFunction, 'set', this); 29 throw MakeTypeError(kPropertyNotFunction, 'set', this);
30 } 30 }
31 for (var nextItem of iterable) { 31 for (var nextItem of iterable) {
32 if (!IS_SPEC_OBJECT(nextItem)) { 32 if (!IS_SPEC_OBJECT(nextItem)) {
33 throw MakeTypeError(kIteratorValueNotAnObject, nextItem); 33 throw MakeTypeError(kIteratorValueNotAnObject, nextItem);
34 } 34 }
35 %_CallFunction(this, nextItem[0], nextItem[1], adder); 35 %_Call(adder, this, nextItem[0], nextItem[1]);
36 } 36 }
37 } 37 }
38 } 38 }
39 39
40 40
41 function WeakMapGet(key) { 41 function WeakMapGet(key) {
42 if (!IS_WEAKMAP(this)) { 42 if (!IS_WEAKMAP(this)) {
43 throw MakeTypeError(kIncompatibleMethodReceiver, 43 throw MakeTypeError(kIncompatibleMethodReceiver,
44 'WeakMap.prototype.get', this); 44 'WeakMap.prototype.get', this);
45 } 45 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 } 111 }
112 112
113 %WeakCollectionInitialize(this); 113 %WeakCollectionInitialize(this);
114 114
115 if (!IS_NULL_OR_UNDEFINED(iterable)) { 115 if (!IS_NULL_OR_UNDEFINED(iterable)) {
116 var adder = this.add; 116 var adder = this.add;
117 if (!IS_CALLABLE(adder)) { 117 if (!IS_CALLABLE(adder)) {
118 throw MakeTypeError(kPropertyNotFunction, 'add', this); 118 throw MakeTypeError(kPropertyNotFunction, 'add', this);
119 } 119 }
120 for (var value of iterable) { 120 for (var value of iterable) {
121 %_CallFunction(this, value, adder); 121 %_Call(adder, this, value);
122 } 122 }
123 } 123 }
124 } 124 }
125 125
126 126
127 function WeakSetAdd(value) { 127 function WeakSetAdd(value) {
128 if (!IS_WEAKSET(this)) { 128 if (!IS_WEAKSET(this)) {
129 throw MakeTypeError(kIncompatibleMethodReceiver, 129 throw MakeTypeError(kIncompatibleMethodReceiver,
130 'WeakSet.prototype.add', this); 130 'WeakSet.prototype.add', this);
131 } 131 }
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 DONT_ENUM | READ_ONLY); 169 DONT_ENUM | READ_ONLY);
170 170
171 // Set up the non-enumerable functions on the WeakSet prototype object. 171 // Set up the non-enumerable functions on the WeakSet prototype object.
172 utils.InstallFunctions(GlobalWeakSet.prototype, DONT_ENUM, [ 172 utils.InstallFunctions(GlobalWeakSet.prototype, DONT_ENUM, [
173 "add", WeakSetAdd, 173 "add", WeakSetAdd,
174 "has", WeakSetHas, 174 "has", WeakSetHas,
175 "delete", WeakSetDelete 175 "delete", WeakSetDelete
176 ]); 176 ]);
177 177
178 }) 178 })
OLDNEW
« no previous file with comments | « src/typedarray.js ('k') | src/x64/interface-descriptors-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698