Title: [183402] trunk/Source/_javascript_Core
Revision
183402
Author
[email protected]
Date
2015-04-27 11:36:14 -0700 (Mon, 27 Apr 2015)

Log Message

Map#entries and Map#keys error for non-Maps is swapped
https://bugs.webkit.org/show_bug.cgi?id=144253

Patch by Jordan Harband <[email protected]> on 2015-04-27
Reviewed by Simon Fraser.

Correcting error messages on Set/Map methods when called on
incompatible objects.

* runtime/MapPrototype.cpp:
(JSC::mapProtoFuncEntries):
(JSC::mapProtoFuncKeys):
* runtime/SetPrototype.cpp:
(JSC::setProtoFuncEntries):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (183401 => 183402)


--- trunk/Source/_javascript_Core/ChangeLog	2015-04-27 18:31:26 UTC (rev 183401)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-04-27 18:36:14 UTC (rev 183402)
@@ -1,3 +1,19 @@
+2015-04-27  Jordan Harband  <[email protected]>
+
+        Map#entries and Map#keys error for non-Maps is swapped
+        https://bugs.webkit.org/show_bug.cgi?id=144253
+
+        Reviewed by Simon Fraser.
+
+        Correcting error messages on Set/Map methods when called on
+        incompatible objects.
+
+        * runtime/MapPrototype.cpp:
+        (JSC::mapProtoFuncEntries):
+        (JSC::mapProtoFuncKeys):
+        * runtime/SetPrototype.cpp:
+        (JSC::setProtoFuncEntries):
+
 2015-04-24  Filip Pizlo  <[email protected]>
 
         Rationalize DFG DCE handling of nodes that perform checks that propagate through AI

Modified: trunk/Source/_javascript_Core/runtime/MapPrototype.cpp (183401 => 183402)


--- trunk/Source/_javascript_Core/runtime/MapPrototype.cpp	2015-04-27 18:31:26 UTC (rev 183401)
+++ trunk/Source/_javascript_Core/runtime/MapPrototype.cpp	2015-04-27 18:36:14 UTC (rev 183402)
@@ -193,7 +193,7 @@
 {
     JSMap* thisObj = jsDynamicCast<JSMap*>(callFrame->thisValue());
     if (!thisObj)
-        return JSValue::encode(throwTypeError(callFrame, ASCIILiteral("Cannot create a Map key iterator for a non-Map object.")));
+        return JSValue::encode(throwTypeError(callFrame, ASCIILiteral("Cannot create a Map entry iterator for a non-Map object.")));
     return JSValue::encode(JSMapIterator::create(callFrame->vm(), callFrame->callee()->globalObject()->mapIteratorStructure(), thisObj, MapIterateKeyValue));
 }
 
@@ -201,7 +201,7 @@
 {
     JSMap* thisObj = jsDynamicCast<JSMap*>(callFrame->thisValue());
     if (!thisObj)
-        return JSValue::encode(throwTypeError(callFrame, ASCIILiteral("Cannot create a Map entry iterator for a non-Map object.")));
+        return JSValue::encode(throwTypeError(callFrame, ASCIILiteral("Cannot create a Map key iterator for a non-Map object.")));
     return JSValue::encode(JSMapIterator::create(callFrame->vm(), callFrame->callee()->globalObject()->mapIteratorStructure(), thisObj, MapIterateKey));
 }
 

Modified: trunk/Source/_javascript_Core/runtime/SetPrototype.cpp (183401 => 183402)


--- trunk/Source/_javascript_Core/runtime/SetPrototype.cpp	2015-04-27 18:31:26 UTC (rev 183401)
+++ trunk/Source/_javascript_Core/runtime/SetPrototype.cpp	2015-04-27 18:36:14 UTC (rev 183402)
@@ -183,7 +183,7 @@
 {
     JSSet* thisObj = jsDynamicCast<JSSet*>(callFrame->thisValue());
     if (!thisObj)
-        return JSValue::encode(throwTypeError(callFrame, ASCIILiteral("Cannot create a Set key iterator for a non-Set object.")));
+        return JSValue::encode(throwTypeError(callFrame, ASCIILiteral("Cannot create a Set entry iterator for a non-Set object.")));
     return JSValue::encode(JSSetIterator::create(callFrame->vm(), callFrame->callee()->globalObject()->setIteratorStructure(), thisObj, SetIterateKeyValue));
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to