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

Side by Side Diff: src/weak-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 | « src/collection.js ('k') | test/mjsunit/es6/collections.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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 return %WeakCollectionDelete(this, key); 78 return %WeakCollectionDelete(this, key);
79 } 79 }
80 80
81 81
82 // ------------------------------------------------------------------- 82 // -------------------------------------------------------------------
83 83
84 function SetUpWeakMap() { 84 function SetUpWeakMap() {
85 %CheckIsBootstrapping(); 85 %CheckIsBootstrapping();
86 86
87 %SetCode($WeakMap, WeakMapConstructor); 87 %SetCode($WeakMap, WeakMapConstructor);
88 %FunctionSetLength($WeakMap, 0);
88 %FunctionSetPrototype($WeakMap, new $Object()); 89 %FunctionSetPrototype($WeakMap, new $Object());
89 %AddNamedProperty($WeakMap.prototype, "constructor", $WeakMap, DONT_ENUM); 90 %AddNamedProperty($WeakMap.prototype, "constructor", $WeakMap, DONT_ENUM);
90 %AddNamedProperty( 91 %AddNamedProperty(
91 $WeakMap.prototype, symbolToStringTag, "WeakMap", DONT_ENUM | READ_ONLY); 92 $WeakMap.prototype, symbolToStringTag, "WeakMap", DONT_ENUM | READ_ONLY);
92 93
93 // Set up the non-enumerable functions on the WeakMap prototype object. 94 // Set up the non-enumerable functions on the WeakMap prototype object.
94 InstallFunctions($WeakMap.prototype, DONT_ENUM, $Array( 95 InstallFunctions($WeakMap.prototype, DONT_ENUM, $Array(
95 "get", WeakMapGet, 96 "get", WeakMapGet,
96 "set", WeakMapSet, 97 "set", WeakMapSet,
97 "has", WeakMapHas, 98 "has", WeakMapHas,
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 return %WeakCollectionDelete(this, value); 156 return %WeakCollectionDelete(this, value);
156 } 157 }
157 158
158 159
159 // ------------------------------------------------------------------- 160 // -------------------------------------------------------------------
160 161
161 function SetUpWeakSet() { 162 function SetUpWeakSet() {
162 %CheckIsBootstrapping(); 163 %CheckIsBootstrapping();
163 164
164 %SetCode($WeakSet, WeakSetConstructor); 165 %SetCode($WeakSet, WeakSetConstructor);
166 %FunctionSetLength($WeakSet, 0);
165 %FunctionSetPrototype($WeakSet, new $Object()); 167 %FunctionSetPrototype($WeakSet, new $Object());
166 %AddNamedProperty($WeakSet.prototype, "constructor", $WeakSet, DONT_ENUM); 168 %AddNamedProperty($WeakSet.prototype, "constructor", $WeakSet, DONT_ENUM);
167 %AddNamedProperty( 169 %AddNamedProperty(
168 $WeakSet.prototype, symbolToStringTag, "WeakSet", DONT_ENUM | READ_ONLY); 170 $WeakSet.prototype, symbolToStringTag, "WeakSet", DONT_ENUM | READ_ONLY);
169 171
170 // Set up the non-enumerable functions on the WeakSet prototype object. 172 // Set up the non-enumerable functions on the WeakSet prototype object.
171 InstallFunctions($WeakSet.prototype, DONT_ENUM, $Array( 173 InstallFunctions($WeakSet.prototype, DONT_ENUM, $Array(
172 "add", WeakSetAdd, 174 "add", WeakSetAdd,
173 "has", WeakSetHas, 175 "has", WeakSetHas,
174 "delete", WeakSetDelete 176 "delete", WeakSetDelete
175 )); 177 ));
176 } 178 }
177 179
178 SetUpWeakSet(); 180 SetUpWeakSet();
OLDNEW
« no previous file with comments | « src/collection.js ('k') | test/mjsunit/es6/collections.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698