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

Side by Side Diff: src/collection.js

Issue 1087633005: Start migrating error message templates to the runtime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix windows build Created 5 years, 8 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 | « BUILD.gn ('k') | src/factory.h » ('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 "use strict"; 5 "use strict";
6 6
7 // This file relies on the fact that the following declaration has been made 7 // This file relies on the fact that the following declaration has been made
8 // in runtime.js: 8 // in runtime.js:
9 // var $Array = global.Array; 9 // var $Array = global.Array;
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 function SetConstructor(iterable) { 95 function SetConstructor(iterable) {
96 if (!%_IsConstructCall()) { 96 if (!%_IsConstructCall()) {
97 throw MakeTypeError('constructor_not_function', ['Set']); 97 throw MakeTypeError('constructor_not_function', ['Set']);
98 } 98 }
99 99
100 %_SetInitialize(this); 100 %_SetInitialize(this);
101 101
102 if (!IS_NULL_OR_UNDEFINED(iterable)) { 102 if (!IS_NULL_OR_UNDEFINED(iterable)) {
103 var adder = this.add; 103 var adder = this.add;
104 if (!IS_SPEC_FUNCTION(adder)) { 104 if (!IS_SPEC_FUNCTION(adder)) {
105 throw MakeTypeError('property_not_function', ['add', this]); 105 throw MakeTypeError(kPropertyNotFunction, ['add', this]);
106 } 106 }
107 107
108 for (var value of iterable) { 108 for (var value of iterable) {
109 %_CallFunction(this, value, adder); 109 %_CallFunction(this, value, adder);
110 } 110 }
111 } 111 }
112 } 112 }
113 113
114 114
115 function SetAdd(key) { 115 function SetAdd(key) {
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 function MapConstructor(iterable) { 261 function MapConstructor(iterable) {
262 if (!%_IsConstructCall()) { 262 if (!%_IsConstructCall()) {
263 throw MakeTypeError('constructor_not_function', ['Map']); 263 throw MakeTypeError('constructor_not_function', ['Map']);
264 } 264 }
265 265
266 %_MapInitialize(this); 266 %_MapInitialize(this);
267 267
268 if (!IS_NULL_OR_UNDEFINED(iterable)) { 268 if (!IS_NULL_OR_UNDEFINED(iterable)) {
269 var adder = this.set; 269 var adder = this.set;
270 if (!IS_SPEC_FUNCTION(adder)) { 270 if (!IS_SPEC_FUNCTION(adder)) {
271 throw MakeTypeError('property_not_function', ['set', this]); 271 throw MakeTypeError(kPropertyNotFunction, ['set', this]);
272 } 272 }
273 273
274 for (var nextItem of iterable) { 274 for (var nextItem of iterable) {
275 if (!IS_SPEC_OBJECT(nextItem)) { 275 if (!IS_SPEC_OBJECT(nextItem)) {
276 throw MakeTypeError('iterator_value_not_an_object', [nextItem]); 276 throw MakeTypeError('iterator_value_not_an_object', [nextItem]);
277 } 277 }
278 %_CallFunction(this, nextItem[0], nextItem[1], adder); 278 %_CallFunction(this, nextItem[0], nextItem[1], adder);
279 } 279 }
280 } 280 }
281 } 281 }
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 InstallFunctions($Map.prototype, DONT_ENUM, [ 438 InstallFunctions($Map.prototype, DONT_ENUM, [
439 "get", MapGet, 439 "get", MapGet,
440 "set", MapSet, 440 "set", MapSet,
441 "has", MapHas, 441 "has", MapHas,
442 "delete", MapDelete, 442 "delete", MapDelete,
443 "clear", MapClearJS, 443 "clear", MapClearJS,
444 "forEach", MapForEach 444 "forEach", MapForEach
445 ]); 445 ]);
446 446
447 })(); 447 })();
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698