Title: [154457] trunk/Source/_javascript_Core
Revision
154457
Author
[email protected]
Date
2013-08-22 12:44:20 -0700 (Thu, 22 Aug 2013)

Log Message

errorDescriptionForValue() should not assume error value is an Object
https://bugs.webkit.org/show_bug.cgi?id=119812

Patch by Chris Curtis <[email protected]> on 2013-08-22
Reviewed by Geoffrey Garen.

Added a check to make sure that the JSValue was an object before casting it as an object. Also, in case the parameterized JSValue
has no type, the function now returns the empty string.
* runtime/ExceptionHelpers.cpp:
(JSC::errorDescriptionForValue):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (154456 => 154457)


--- trunk/Source/_javascript_Core/ChangeLog	2013-08-22 19:28:58 UTC (rev 154456)
+++ trunk/Source/_javascript_Core/ChangeLog	2013-08-22 19:44:20 UTC (rev 154457)
@@ -1,3 +1,15 @@
+2013-08-22  Chris Curtis  <[email protected]>
+
+        errorDescriptionForValue() should not assume error value is an Object
+        https://bugs.webkit.org/show_bug.cgi?id=119812
+
+        Reviewed by Geoffrey Garen.
+
+        Added a check to make sure that the JSValue was an object before casting it as an object. Also, in case the parameterized JSValue
+        has no type, the function now returns the empty string. 
+        * runtime/ExceptionHelpers.cpp:
+        (JSC::errorDescriptionForValue):
+
 2013-08-22  Julien Brianceau  <[email protected]>
 
         Fix P_DFGOperation_EJS call for MIPS and ARM EABI.

Modified: trunk/Source/_javascript_Core/runtime/ExceptionHelpers.cpp (154456 => 154457)


--- trunk/Source/_javascript_Core/runtime/ExceptionHelpers.cpp	2013-08-22 19:28:58 UTC (rev 154456)
+++ trunk/Source/_javascript_Core/runtime/ExceptionHelpers.cpp	2013-08-22 19:44:20 UTC (rev 154457)
@@ -106,8 +106,12 @@
         JSObject* object = asObject(v);
         if (object->methodTable()->getCallData(object, callData) != CallTypeNone)
             return vm.smallStrings.functionString();
+        return jsString(exec, object->methodTable()->className(object));
     }
-    return jsString(exec, asObject(v)->methodTable()->className(asObject(v)));
+    
+    ASSERT(v.isEmpty());
+    // FIXME: https://bugs.webkit.org/show_bug.cgi?id=120080 The JSValue should never be empty in this function.
+    return vm.smallStrings.emptyString();
 }
     
 JSObject* createError(ExecState* exec, ErrorFactory errorFactory, JSValue value, const String& message)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to