Ignore:
Timestamp:
Aug 22, 2013, 12:44:20 PM (12 years ago)
Author:
[email protected]
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):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/ExceptionHelpers.cpp

    r154038 r154457  
    107107        if (object->methodTable()->getCallData(object, callData) != CallTypeNone)
    108108            return vm.smallStrings.functionString();
     109        return jsString(exec, object->methodTable()->className(object));
    109110    }
    110     return jsString(exec, asObject(v)->methodTable()->className(asObject(v)));
     111   
     112    ASSERT(v.isEmpty());
     113    // FIXME: https://bugs.webkit.org/show_bug.cgi?id=120080 The JSValue should never be empty in this function.
     114    return vm.smallStrings.emptyString();
    111115}
    112116   
Note: See TracChangeset for help on using the changeset viewer.