Objective-C API for JavaScriptCore
authorbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Jan 2013 02:03:12 +0000 (02:03 +0000)
committerbarraclough@apple.com <barraclough@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 3 Jan 2013 02:03:12 +0000 (02:03 +0000)
commit54435072e56ce628945210cd57b36c9f578391d7
tree2f1ac097b0576f4f27657541b9006b70baa3740f
parent7867f8084081cea7cb7e1d037b0080a6a8ab9694
Objective-C API for JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=105889

Reviewed by Geoff Garen.

Fixes for more issues raised by Darin.

* API/JSBlockAdaptor.mm:
(BlockArgument):
(BlockArgumentStruct::BlockArgumentStruct):
(BlockArgumentTypeDelegate::typeStruct):
(BlockResult):
(BlockResultStruct::BlockResultStruct):
(buildBlockSignature):
(-[JSBlockAdaptor initWithBlockSignatureFromProtocol:]):
(-[JSBlockAdaptor blockFromValue:inContext:withException:]):
    - fix * position for Objective-C types
* API/JSContext.h:
    - fix * position for Objective-C types
* API/JSContext.mm:
(-[JSContext initWithVirtualMachine:]):
(-[JSContext virtualMachine]):
(contextInternalContext):
    - fix * position for Objective-C types
(-[JSContext dealloc]):
(-[JSContext protect:]):
(-[JSContext unprotect:]):
    - HashMap<JSValueRef, size_t> -> HashCountedSet<JSValueRef>
* API/JSContextInternal.h:
(WeakContextRef):
    - fix * position for Objective-C types
* API/JSValue.mm:
(valueToString):
    - fix * position for Objective-C types
(isNSBoolean):
    - Added helper to check for booleans.
(objectToValueWithoutCopy):
    - Added contextRef
    - fix * position for Objective-C types
    - Remove @YES, @NO literal usage, use isNSBoolean instead
(objectToValue):
    - Added contextRef
(+[JSValue valueWithValue:inContext:]):
(-[JSValue initWithValue:inContext:]):
    - fix * position for Objective-C types
(createStructHandlerMap):
(handerForStructTag):
    - getStructTagHandler -> handerForStructTag
    - Split out createStructHandlerMap
    - strncmp -> memcmp
    - String(type).impl() -> StringImpl::create(type)
(+[JSValue selectorForStructToValue:]):
(+[JSValue selectorForValueToStruct:]):
    - getStructTagHandler -> handerForStructTag
(typeToValueInvocationFor):
(valueToTypeInvocationFor):
    - fix * position for Objective-C types
* API/JSValueInternal.h:
    - fix * position for Objective-C types
* API/JSVirtualMachineInternal.h:
    - fix * position for Objective-C types
* API/JSWrapperMap.h:
    - fix * position for Objective-C types
* API/JSWrapperMap.mm:
(selectorToPropertyName):
(createObjectWithCustomBrand):
(createRenameMap):
(putNonEnumerable):
(copyMethodsToObject):
(copyPrototypeProperties):
(-[JSObjCClassInfo initWithContext:forClass:superClassInfo:]):
(-[JSWrapperMap initWithContext:]):
(-[JSWrapperMap wrapperForObject:]):
(getJSExportProtocol):
    - fix * position for Objective-C types
* API/ObjCCallbackFunction.h:
    - fix * position for Objective-C types
* API/ObjCCallbackFunction.mm:
(CallbackArgument):
(CallbackArgumentStruct::CallbackArgumentStruct):
    - fix * position for Objective-C types
(CallbackArgumentBlockCallback::createAdoptingJSBlockAdaptor):
    - Added to make adopt explicit
(CallbackArgumentBlockCallback):
(CallbackArgumentBlockCallback::CallbackArgumentBlockCallback):
(ArgumentTypeDelegate::typeBlock):
    - Call createAdoptingJSBlockAdaptor
(ArgumentTypeDelegate::typeStruct):
(CallbackResult):
(CallbackResultStruct::CallbackResultStruct):
(ResultTypeDelegate::typeStruct):
(ObjCCallbackFunction::ObjCCallbackFunction):
(ObjCCallbackFunction::context):
(objCCallbackFunctionForInvocation):
(objCCallbackFunctionForMethod):
(objCCallbackFunctionForBlock):
    - fix * position for Objective-C types
* API/ObjcRuntimeExtras.h:
(protocolImplementsProtocol):
(forEachProtocolImplementingProtocol):
(forEachMethodInProtocol):
(forEachPropertyInProtocol):
    - fix * position for Objective-C types
* API/tests/testapi.m:
(-[TestObject testArgumentTypesWithInt:double:boolean:string:number:array:dictionary:]):
(testObjectiveCAPI):
    - fix * position for Objective-C types

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@138689 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/JavaScriptCore/API/JSBlockAdaptor.mm
Source/JavaScriptCore/API/JSContext.h
Source/JavaScriptCore/API/JSContext.mm
Source/JavaScriptCore/API/JSContextInternal.h
Source/JavaScriptCore/API/JSValue.mm
Source/JavaScriptCore/API/JSValueInternal.h
Source/JavaScriptCore/API/JSVirtualMachineInternal.h
Source/JavaScriptCore/API/JSWrapperMap.h
Source/JavaScriptCore/API/JSWrapperMap.mm
Source/JavaScriptCore/API/ObjCCallbackFunction.h
Source/JavaScriptCore/API/ObjCCallbackFunction.mm
Source/JavaScriptCore/API/ObjcRuntimeExtras.h
Source/JavaScriptCore/API/tests/testapi.m
Source/JavaScriptCore/ChangeLog