Commit ac4bd2b4 authored by commit-queue@webkit.org's avatar commit-queue@webkit.org
Browse files

errorDescriptionForValue() should not assume error value is an Object

https://bugs.webkit.org/show_bug.cgi?id=119812

Patch by Chris Curtis <chris_curtis@apple.com> 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):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@154457 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ecd377bf
2013-08-22 Chris Curtis <chris_curtis@apple.com>
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 <jbrianceau@nds.com>
 
Fix P_DFGOperation_EJS call for MIPS and ARM EABI.
......
......@@ -106,8 +106,12 @@ JSString* errorDescriptionForValue(ExecState* exec, JSValue v)
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)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment