Ignore:
Timestamp:
Feb 14, 2014, 2:44:52 PM (11 years ago)
Author:
[email protected]
Message:

ASSERT(isValidAllocation(bytes)) when ObjC API creates custom errors
https://bugs.webkit.org/show_bug.cgi?id=128840

Reviewed by Joseph Pecoraro.

We need to add APIEntryShims around places where we allocate errors in JSC.
Also converted some of the createTypeError call sites to use ASCIILiteral.

  • API/JSValue.mm:

(valueToArray):
(valueToDictionary):

  • API/ObjCCallbackFunction.mm:

(JSC::objCCallbackFunctionCallAsConstructor):
(JSC::ObjCCallbackFunctionImpl::call):

  • API/tests/testapi.mm:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/API/ObjCCallbackFunction.mm

    r163590 r164136  
    130130        }
    131131
    132         *exception = toRef(JSC::createTypeError(toJS(contextRef), "Argument does not match Objective-C Class"));
     132        *exception = toRef(JSC::createTypeError(toJS(contextRef), ASCIILiteral("Argument does not match Objective-C Class")));
    133133    }
    134134
     
    497497
    498498    if (!JSValueIsObject(contextRef, result)) {
    499         *exception = toRef(JSC::createTypeError(toJS(contextRef), "Objective-C blocks called as constructors must return an object."));
     499        *exception = toRef(JSC::createTypeError(toJS(contextRef), ASCIILiteral("Objective-C blocks called as constructors must return an object.")));
    500500        return 0;
    501501    }
     
    563563        target = [m_instanceClass alloc];
    564564        if (!target || ![target isKindOfClass:m_instanceClass]) {
    565             *exception = toRef(JSC::createTypeError(toJS(contextRef), "self type check failed for Objective-C instance method"));
     565            *exception = toRef(JSC::createTypeError(toJS(contextRef), ASCIILiteral("self type check failed for Objective-C instance method")));
    566566            return JSValueMakeUndefined(contextRef);
    567567        }
     
    573573        target = tryUnwrapObjcObject(contextRef, thisObject);
    574574        if (!target || ![target isKindOfClass:m_instanceClass]) {
    575             *exception = toRef(JSC::createTypeError(toJS(contextRef), "self type check failed for Objective-C instance method"));
     575            *exception = toRef(JSC::createTypeError(toJS(contextRef), ASCIILiteral("self type check failed for Objective-C instance method")));
    576576            return JSValueMakeUndefined(contextRef);
    577577        }
Note: See TracChangeset for help on using the changeset viewer.