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

Side by Side Diff: src/collection.js

Issue 1073233002: [es6] Fix length property of collection constructors (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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 | « no previous file | src/weak-collection.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 "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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 while (%SetIteratorNext(iterator, value_array)) { 229 while (%SetIteratorNext(iterator, value_array)) {
230 if (stepping) %DebugPrepareStepInIfStepping(f); 230 if (stepping) %DebugPrepareStepInIfStepping(f);
231 key = value_array[0]; 231 key = value_array[0];
232 var new_receiver = needs_wrapper ? ToObject(receiver) : receiver; 232 var new_receiver = needs_wrapper ? ToObject(receiver) : receiver;
233 %_CallFunction(new_receiver, key, key, this, f); 233 %_CallFunction(new_receiver, key, key, this, f);
234 } 234 }
235 } 235 }
236 236
237 237
238 %SetCode($Set, SetConstructor); 238 %SetCode($Set, SetConstructor);
239 %FunctionSetLength($Set, 0);
239 %FunctionSetPrototype($Set, new $Object()); 240 %FunctionSetPrototype($Set, new $Object());
240 %AddNamedProperty($Set.prototype, "constructor", $Set, DONT_ENUM); 241 %AddNamedProperty($Set.prototype, "constructor", $Set, DONT_ENUM);
241 %AddNamedProperty( 242 %AddNamedProperty(
242 $Set.prototype, symbolToStringTag, "Set", DONT_ENUM | READ_ONLY); 243 $Set.prototype, symbolToStringTag, "Set", DONT_ENUM | READ_ONLY);
243 244
244 %FunctionSetLength(SetForEach, 1); 245 %FunctionSetLength(SetForEach, 1);
245 246
246 // Set up the non-enumerable functions on the Set prototype object. 247 // Set up the non-enumerable functions on the Set prototype object.
247 InstallGetter($Set.prototype, "size", SetGetSize); 248 InstallGetter($Set.prototype, "size", SetGetSize);
248 InstallFunctions($Set.prototype, DONT_ENUM, $Array( 249 InstallFunctions($Set.prototype, DONT_ENUM, $Array(
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 var value_array = [UNDEFINED, UNDEFINED]; 418 var value_array = [UNDEFINED, UNDEFINED];
418 while (%MapIteratorNext(iterator, value_array)) { 419 while (%MapIteratorNext(iterator, value_array)) {
419 if (stepping) %DebugPrepareStepInIfStepping(f); 420 if (stepping) %DebugPrepareStepInIfStepping(f);
420 var new_receiver = needs_wrapper ? ToObject(receiver) : receiver; 421 var new_receiver = needs_wrapper ? ToObject(receiver) : receiver;
421 %_CallFunction(new_receiver, value_array[1], value_array[0], this, f); 422 %_CallFunction(new_receiver, value_array[1], value_array[0], this, f);
422 } 423 }
423 } 424 }
424 425
425 426
426 %SetCode($Map, MapConstructor); 427 %SetCode($Map, MapConstructor);
428 %FunctionSetLength($Map, 0);
427 %FunctionSetPrototype($Map, new $Object()); 429 %FunctionSetPrototype($Map, new $Object());
428 %AddNamedProperty($Map.prototype, "constructor", $Map, DONT_ENUM); 430 %AddNamedProperty($Map.prototype, "constructor", $Map, DONT_ENUM);
429 %AddNamedProperty( 431 %AddNamedProperty(
430 $Map.prototype, symbolToStringTag, "Map", DONT_ENUM | READ_ONLY); 432 $Map.prototype, symbolToStringTag, "Map", DONT_ENUM | READ_ONLY);
431 433
432 %FunctionSetLength(MapForEach, 1); 434 %FunctionSetLength(MapForEach, 1);
433 435
434 // Set up the non-enumerable functions on the Map prototype object. 436 // Set up the non-enumerable functions on the Map prototype object.
435 InstallGetter($Map.prototype, "size", MapGetSize); 437 InstallGetter($Map.prototype, "size", MapGetSize);
436 InstallFunctions($Map.prototype, DONT_ENUM, $Array( 438 InstallFunctions($Map.prototype, DONT_ENUM, $Array(
437 "get", MapGet, 439 "get", MapGet,
438 "set", MapSet, 440 "set", MapSet,
439 "has", MapHas, 441 "has", MapHas,
440 "delete", MapDelete, 442 "delete", MapDelete,
441 "clear", MapClearJS, 443 "clear", MapClearJS,
442 "forEach", MapForEach 444 "forEach", MapForEach
443 )); 445 ));
444 446
445 })(); 447 })();
OLDNEW
« no previous file with comments | « no previous file | src/weak-collection.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698