[ES6] Drop WeakMap#clear
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 31 May 2015 15:10:09 +0000 (15:10 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 31 May 2015 15:10:09 +0000 (15:10 +0000)
https://bugs.webkit.org/show_bug.cgi?id=145489

Reviewed by Mark Lam.

ES6 spec intentionally drops the WeakMap#clear
to allow engine to implement WeakMap as a per-object table.

This patch drops WeakMap.prototype.clear.

* runtime/WeakMapPrototype.cpp:
(JSC::WeakMapPrototype::finishCreation): Deleted.
(JSC::protoFuncWeakMapClear): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@185041 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/runtime/WeakMapPrototype.cpp

index 6e6c282..22fe9cc 100644 (file)
@@ -1,3 +1,19 @@
+2015-05-31  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [ES6] Drop WeakMap#clear
+        https://bugs.webkit.org/show_bug.cgi?id=145489
+
+        Reviewed by Mark Lam.
+
+        ES6 spec intentionally drops the WeakMap#clear
+        to allow engine to implement WeakMap as a per-object table.
+
+        This patch drops WeakMap.prototype.clear.
+
+        * runtime/WeakMapPrototype.cpp:
+        (JSC::WeakMapPrototype::finishCreation): Deleted.
+        (JSC::protoFuncWeakMapClear): Deleted.
+
 2015-05-31  Jordan Harband  <ljharb@gmail.com>
 
         Array#reduce and reduceRight don't follow ToLength
index cee7850..71c4c40 100644 (file)
@@ -35,7 +35,6 @@ namespace JSC {
 
 const ClassInfo WeakMapPrototype::s_info = { "WeakMap", &Base::s_info, 0, CREATE_METHOD_TABLE(WeakMapPrototype) };
 
-static EncodedJSValue JSC_HOST_CALL protoFuncWeakMapClear(ExecState*);
 static EncodedJSValue JSC_HOST_CALL protoFuncWeakMapDelete(ExecState*);
 static EncodedJSValue JSC_HOST_CALL protoFuncWeakMapGet(ExecState*);
 static EncodedJSValue JSC_HOST_CALL protoFuncWeakMapHas(ExecState*);
@@ -47,7 +46,6 @@ void WeakMapPrototype::finishCreation(VM& vm, JSGlobalObject* globalObject)
     ASSERT(inherits(info()));
     vm.prototypeMap.addPrototype(this);
 
-    JSC_NATIVE_FUNCTION(vm.propertyNames->clear, protoFuncWeakMapClear, DontEnum, 0);
     JSC_NATIVE_FUNCTION(vm.propertyNames->deleteKeyword, protoFuncWeakMapDelete, DontEnum, 1);
     JSC_NATIVE_FUNCTION(vm.propertyNames->get, protoFuncWeakMapGet, DontEnum, 1);
     JSC_NATIVE_FUNCTION(vm.propertyNames->has, protoFuncWeakMapHas, DontEnum, 1);
@@ -68,15 +66,6 @@ static WeakMapData* getWeakMapData(CallFrame* callFrame, JSValue value)
     return nullptr;
 }
 
-EncodedJSValue JSC_HOST_CALL protoFuncWeakMapClear(CallFrame* callFrame)
-{
-    WeakMapData* map = getWeakMapData(callFrame, callFrame->thisValue());
-    if (!map)
-        return JSValue::encode(jsUndefined());
-    map->clear();
-    return JSValue::encode(jsUndefined());
-}
-
 EncodedJSValue JSC_HOST_CALL protoFuncWeakMapDelete(CallFrame* callFrame)
 {
     WeakMapData* map = getWeakMapData(callFrame, callFrame->thisValue());