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

Unified Diff: src/weak-collection.js

Issue 739303002: Remove Weak{Map,Set}.prototype.clear. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | test/mjsunit/es6/collections.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/weak-collection.js
diff --git a/src/weak-collection.js b/src/weak-collection.js
index 273060adff58b6276d820d23376364e93759c185..a44c3d7cd7caeb2d7eb835b002332fc8df30a679 100644
--- a/src/weak-collection.js
+++ b/src/weak-collection.js
@@ -96,16 +96,6 @@ function WeakMapDelete(key) {
}
-function WeakMapClear() {
- if (!IS_WEAKMAP(this)) {
- throw MakeTypeError('incompatible_method_receiver',
- ['WeakMap.prototype.clear', this]);
- }
- // Replace the internal table with a new empty table.
- %WeakCollectionInitialize(this);
-}
-
-
// -------------------------------------------------------------------
function SetUpWeakMap() {
@@ -122,8 +112,7 @@ function SetUpWeakMap() {
"get", WeakMapGet,
"set", WeakMapSet,
"has", WeakMapHas,
- "delete", WeakMapDelete,
- "clear", WeakMapClear
+ "delete", WeakMapDelete
));
}
@@ -198,16 +187,6 @@ function WeakSetDelete(value) {
}
-function WeakSetClear() {
- if (!IS_WEAKSET(this)) {
- throw MakeTypeError('incompatible_method_receiver',
- ['WeakSet.prototype.clear', this]);
- }
- // Replace the internal table with a new empty table.
- %WeakCollectionInitialize(this);
-}
-
-
// -------------------------------------------------------------------
function SetUpWeakSet() {
@@ -223,8 +202,7 @@ function SetUpWeakSet() {
InstallFunctions($WeakSet.prototype, DONT_ENUM, $Array(
"add", WeakSetAdd,
"has", WeakSetHas,
- "delete", WeakSetDelete,
- "clear", WeakSetClear
+ "delete", WeakSetDelete
));
}
« no previous file with comments | « no previous file | test/mjsunit/es6/collections.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698