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

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

Issue 1477073005: Use new.target in favor of %_IsConstructCall intrinsic (1). (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 | « no previous file | src/js/harmony-sharedarraybuffer.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 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 "use strict"; 6 "use strict";
7 7
8 %CheckIsBootstrapping(); 8 %CheckIsBootstrapping();
9 9
10 // ------------------------------------------------------------------- 10 // -------------------------------------------------------------------
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 } 118 }
119 return hash; 119 return hash;
120 } 120 }
121 %SetForceInlineFlag(GetHash); 121 %SetForceInlineFlag(GetHash);
122 122
123 123
124 // ------------------------------------------------------------------- 124 // -------------------------------------------------------------------
125 // Harmony Set 125 // Harmony Set
126 126
127 function SetConstructor(iterable) { 127 function SetConstructor(iterable) {
128 if (!%_IsConstructCall()) { 128 if (IS_UNDEFINED(new.target)) {
129 throw MakeTypeError(kConstructorNotFunction, "Set"); 129 throw MakeTypeError(kConstructorNotFunction, "Set");
130 } 130 }
131 131
132 %_SetInitialize(this); 132 %_SetInitialize(this);
133 133
134 if (!IS_NULL_OR_UNDEFINED(iterable)) { 134 if (!IS_NULL_OR_UNDEFINED(iterable)) {
135 var adder = this.add; 135 var adder = this.add;
136 if (!IS_CALLABLE(adder)) { 136 if (!IS_CALLABLE(adder)) {
137 throw MakeTypeError(kPropertyNotFunction, 'add', this); 137 throw MakeTypeError(kPropertyNotFunction, 'add', this);
138 } 138 }
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 "delete", SetDelete, 274 "delete", SetDelete,
275 "clear", SetClearJS, 275 "clear", SetClearJS,
276 "forEach", SetForEach 276 "forEach", SetForEach
277 ]); 277 ]);
278 278
279 279
280 // ------------------------------------------------------------------- 280 // -------------------------------------------------------------------
281 // Harmony Map 281 // Harmony Map
282 282
283 function MapConstructor(iterable) { 283 function MapConstructor(iterable) {
284 if (!%_IsConstructCall()) { 284 if (IS_UNDEFINED(new.target)) {
285 throw MakeTypeError(kConstructorNotFunction, "Map"); 285 throw MakeTypeError(kConstructorNotFunction, "Map");
286 } 286 }
287 287
288 %_MapInitialize(this); 288 %_MapInitialize(this);
289 289
290 if (!IS_NULL_OR_UNDEFINED(iterable)) { 290 if (!IS_NULL_OR_UNDEFINED(iterable)) {
291 var adder = this.set; 291 var adder = this.set;
292 if (!IS_CALLABLE(adder)) { 292 if (!IS_CALLABLE(adder)) {
293 throw MakeTypeError(kPropertyNotFunction, 'set', this); 293 throw MakeTypeError(kPropertyNotFunction, 'set', this);
294 } 294 }
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
469 "set_has", SetHas, 469 "set_has", SetHas,
470 "set_delete", SetDelete, 470 "set_delete", SetDelete,
471 ]); 471 ]);
472 472
473 utils.Export(function(to) { 473 utils.Export(function(to) {
474 to.GetExistingHash = GetExistingHash; 474 to.GetExistingHash = GetExistingHash;
475 to.GetHash = GetHash; 475 to.GetHash = GetHash;
476 }); 476 });
477 477
478 }) 478 })
OLDNEW
« no previous file with comments | « no previous file | src/js/harmony-sharedarraybuffer.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698