javascriptcore

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 19, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Rendered for darwin/amd64

Overview

Package javascriptcore provides a fluent Go API over the macOS JavaScriptCore framework.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CurrentArguments

func CurrentArguments() *foundation.NSArray[objc.ID]

CurrentArguments calls the underlying JSContextCurrentArguments.

func JSBigIntCreateWithDouble

func JSBigIntCreateWithDouble(ctx unsafe.Pointer, value float64, exception unsafe.Pointer) unsafe.Pointer

JSBigIntCreateWithDouble calls raw.JSBigIntCreateWithDouble (C function JSBigIntCreateWithDouble).

func JSBigIntCreateWithInt64

func JSBigIntCreateWithInt64(ctx unsafe.Pointer, integer int64, exception unsafe.Pointer) unsafe.Pointer

JSBigIntCreateWithInt64 calls raw.JSBigIntCreateWithInt64 (C function JSBigIntCreateWithInt64).

func JSBigIntCreateWithString

func JSBigIntCreateWithString(ctx unsafe.Pointer, string_ unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer

JSBigIntCreateWithString calls raw.JSBigIntCreateWithString (C function JSBigIntCreateWithString).

func JSBigIntCreateWithUInt64

func JSBigIntCreateWithUInt64(ctx unsafe.Pointer, integer uint64, exception unsafe.Pointer) unsafe.Pointer

JSBigIntCreateWithUInt64 calls raw.JSBigIntCreateWithUInt64 (C function JSBigIntCreateWithUInt64).

func JSCheckScriptSyntax

func JSCheckScriptSyntax(ctx unsafe.Pointer, script unsafe.Pointer, sourceURL unsafe.Pointer, startingLineNumber int, exception unsafe.Pointer) bool

JSCheckScriptSyntax calls raw.JSCheckScriptSyntax (C function JSCheckScriptSyntax).

func JSClassCreate

func JSClassCreate(definition *raw.JSClassDefinition) unsafe.Pointer

JSClassCreate calls raw.JSClassCreate (C function JSClassCreate).

func JSClassRelease

func JSClassRelease(jsClass unsafe.Pointer)

JSClassRelease calls raw.JSClassRelease (C function JSClassRelease).

func JSClassRetain

func JSClassRetain(jsClass unsafe.Pointer) unsafe.Pointer

JSClassRetain calls raw.JSClassRetain (C function JSClassRetain).

func JSContextGetGlobalContext

func JSContextGetGlobalContext(ctx unsafe.Pointer) unsafe.Pointer

JSContextGetGlobalContext calls raw.JSContextGetGlobalContext (C function JSContextGetGlobalContext).

func JSContextGetGlobalObject

func JSContextGetGlobalObject(ctx unsafe.Pointer) unsafe.Pointer

JSContextGetGlobalObject calls raw.JSContextGetGlobalObject (C function JSContextGetGlobalObject).

func JSContextGetGroup

func JSContextGetGroup(ctx unsafe.Pointer) unsafe.Pointer

JSContextGetGroup calls raw.JSContextGetGroup (C function JSContextGetGroup).

func JSContextGroupCreate

func JSContextGroupCreate() unsafe.Pointer

JSContextGroupCreate calls raw.JSContextGroupCreate (C function JSContextGroupCreate).

func JSContextGroupRelease

func JSContextGroupRelease(group unsafe.Pointer)

JSContextGroupRelease calls raw.JSContextGroupRelease (C function JSContextGroupRelease).

func JSContextGroupRetain

func JSContextGroupRetain(group unsafe.Pointer) unsafe.Pointer

JSContextGroupRetain calls raw.JSContextGroupRetain (C function JSContextGroupRetain).

func JSEvaluateScript

func JSEvaluateScript(ctx unsafe.Pointer, script unsafe.Pointer, thisObject unsafe.Pointer, sourceURL unsafe.Pointer, startingLineNumber int, exception unsafe.Pointer) unsafe.Pointer

JSEvaluateScript calls raw.JSEvaluateScript (C function JSEvaluateScript).

func JSGarbageCollect

func JSGarbageCollect(ctx unsafe.Pointer)

JSGarbageCollect calls raw.JSGarbageCollect (C function JSGarbageCollect).

func JSGlobalContextCopyName

func JSGlobalContextCopyName(ctx unsafe.Pointer) unsafe.Pointer

JSGlobalContextCopyName calls raw.JSGlobalContextCopyName (C function JSGlobalContextCopyName).

func JSGlobalContextCreate

func JSGlobalContextCreate(globalObjectClass unsafe.Pointer) unsafe.Pointer

JSGlobalContextCreate calls raw.JSGlobalContextCreate (C function JSGlobalContextCreate).

func JSGlobalContextCreateInGroup

func JSGlobalContextCreateInGroup(group unsafe.Pointer, globalObjectClass unsafe.Pointer) unsafe.Pointer

JSGlobalContextCreateInGroup calls raw.JSGlobalContextCreateInGroup (C function JSGlobalContextCreateInGroup).

func JSGlobalContextIsInspectable

func JSGlobalContextIsInspectable(ctx unsafe.Pointer) bool

JSGlobalContextIsInspectable calls raw.JSGlobalContextIsInspectable (C function JSGlobalContextIsInspectable).

func JSGlobalContextRelease

func JSGlobalContextRelease(ctx unsafe.Pointer)

JSGlobalContextRelease calls raw.JSGlobalContextRelease (C function JSGlobalContextRelease).

func JSGlobalContextRetain

func JSGlobalContextRetain(ctx unsafe.Pointer) unsafe.Pointer

JSGlobalContextRetain calls raw.JSGlobalContextRetain (C function JSGlobalContextRetain).

func JSGlobalContextSetInspectable

func JSGlobalContextSetInspectable(ctx unsafe.Pointer, inspectable bool)

JSGlobalContextSetInspectable calls raw.JSGlobalContextSetInspectable (C function JSGlobalContextSetInspectable).

func JSGlobalContextSetName

func JSGlobalContextSetName(ctx unsafe.Pointer, name unsafe.Pointer)

JSGlobalContextSetName calls raw.JSGlobalContextSetName (C function JSGlobalContextSetName).

func JSObjectCallAsConstructor

func JSObjectCallAsConstructor(ctx unsafe.Pointer, object unsafe.Pointer, argumentCount uint, arguments unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer

JSObjectCallAsConstructor calls raw.JSObjectCallAsConstructor (C function JSObjectCallAsConstructor).

func JSObjectCallAsFunction

func JSObjectCallAsFunction(ctx unsafe.Pointer, object unsafe.Pointer, thisObject unsafe.Pointer, argumentCount uint, arguments unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer

JSObjectCallAsFunction calls raw.JSObjectCallAsFunction (C function JSObjectCallAsFunction).

func JSObjectCopyPropertyNames

func JSObjectCopyPropertyNames(ctx unsafe.Pointer, object unsafe.Pointer) unsafe.Pointer

JSObjectCopyPropertyNames calls raw.JSObjectCopyPropertyNames (C function JSObjectCopyPropertyNames).

func JSObjectDeleteProperty

func JSObjectDeleteProperty(ctx unsafe.Pointer, object unsafe.Pointer, propertyName unsafe.Pointer, exception unsafe.Pointer) bool

JSObjectDeleteProperty calls raw.JSObjectDeleteProperty (C function JSObjectDeleteProperty).

func JSObjectDeletePropertyForKey

func JSObjectDeletePropertyForKey(ctx unsafe.Pointer, object unsafe.Pointer, propertyKey unsafe.Pointer, exception unsafe.Pointer) bool

JSObjectDeletePropertyForKey calls raw.JSObjectDeletePropertyForKey (C function JSObjectDeletePropertyForKey).

func JSObjectGetArrayBufferByteLength

func JSObjectGetArrayBufferByteLength(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) uint

JSObjectGetArrayBufferByteLength calls raw.JSObjectGetArrayBufferByteLength (C function JSObjectGetArrayBufferByteLength).

func JSObjectGetArrayBufferBytesPtr

func JSObjectGetArrayBufferBytesPtr(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer

JSObjectGetArrayBufferBytesPtr calls raw.JSObjectGetArrayBufferBytesPtr (C function JSObjectGetArrayBufferBytesPtr).

func JSObjectGetPrivate

func JSObjectGetPrivate(object unsafe.Pointer) unsafe.Pointer

JSObjectGetPrivate calls raw.JSObjectGetPrivate (C function JSObjectGetPrivate).

func JSObjectGetProperty

func JSObjectGetProperty(ctx unsafe.Pointer, object unsafe.Pointer, propertyName unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer

JSObjectGetProperty calls raw.JSObjectGetProperty (C function JSObjectGetProperty).

func JSObjectGetPropertyAtIndex

func JSObjectGetPropertyAtIndex(ctx unsafe.Pointer, object unsafe.Pointer, propertyIndex uint, exception unsafe.Pointer) unsafe.Pointer

JSObjectGetPropertyAtIndex calls raw.JSObjectGetPropertyAtIndex (C function JSObjectGetPropertyAtIndex).

func JSObjectGetPropertyForKey

func JSObjectGetPropertyForKey(ctx unsafe.Pointer, object unsafe.Pointer, propertyKey unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer

JSObjectGetPropertyForKey calls raw.JSObjectGetPropertyForKey (C function JSObjectGetPropertyForKey).

func JSObjectGetPrototype

func JSObjectGetPrototype(ctx unsafe.Pointer, object unsafe.Pointer) unsafe.Pointer

JSObjectGetPrototype calls raw.JSObjectGetPrototype (C function JSObjectGetPrototype).

func JSObjectGetTypedArrayBuffer

func JSObjectGetTypedArrayBuffer(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer

JSObjectGetTypedArrayBuffer calls raw.JSObjectGetTypedArrayBuffer (C function JSObjectGetTypedArrayBuffer).

func JSObjectGetTypedArrayByteLength

func JSObjectGetTypedArrayByteLength(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) uint

JSObjectGetTypedArrayByteLength calls raw.JSObjectGetTypedArrayByteLength (C function JSObjectGetTypedArrayByteLength).

func JSObjectGetTypedArrayByteOffset

func JSObjectGetTypedArrayByteOffset(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) uint

JSObjectGetTypedArrayByteOffset calls raw.JSObjectGetTypedArrayByteOffset (C function JSObjectGetTypedArrayByteOffset).

func JSObjectGetTypedArrayBytesPtr

func JSObjectGetTypedArrayBytesPtr(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer

JSObjectGetTypedArrayBytesPtr calls raw.JSObjectGetTypedArrayBytesPtr (C function JSObjectGetTypedArrayBytesPtr).

func JSObjectGetTypedArrayLength

func JSObjectGetTypedArrayLength(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) uint

JSObjectGetTypedArrayLength calls raw.JSObjectGetTypedArrayLength (C function JSObjectGetTypedArrayLength).

func JSObjectHasProperty

func JSObjectHasProperty(ctx unsafe.Pointer, object unsafe.Pointer, propertyName unsafe.Pointer) bool

JSObjectHasProperty calls raw.JSObjectHasProperty (C function JSObjectHasProperty).

func JSObjectHasPropertyForKey

func JSObjectHasPropertyForKey(ctx unsafe.Pointer, object unsafe.Pointer, propertyKey unsafe.Pointer, exception unsafe.Pointer) bool

JSObjectHasPropertyForKey calls raw.JSObjectHasPropertyForKey (C function JSObjectHasPropertyForKey).

func JSObjectIsConstructor

func JSObjectIsConstructor(ctx unsafe.Pointer, object unsafe.Pointer) bool

JSObjectIsConstructor calls raw.JSObjectIsConstructor (C function JSObjectIsConstructor).

func JSObjectIsFunction

func JSObjectIsFunction(ctx unsafe.Pointer, object unsafe.Pointer) bool

JSObjectIsFunction calls raw.JSObjectIsFunction (C function JSObjectIsFunction).

func JSObjectMake

func JSObjectMake(ctx unsafe.Pointer, jsClass unsafe.Pointer, data unsafe.Pointer) unsafe.Pointer

JSObjectMake calls raw.JSObjectMake (C function JSObjectMake).

func JSObjectMakeArray

func JSObjectMakeArray(ctx unsafe.Pointer, argumentCount uint, arguments unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer

JSObjectMakeArray calls raw.JSObjectMakeArray (C function JSObjectMakeArray).

func JSObjectMakeArrayBufferWithBytesNoCopy

func JSObjectMakeArrayBufferWithBytesNoCopy(ctx unsafe.Pointer, bytes_ unsafe.Pointer, byteLength uint, bytesDeallocator unsafe.Pointer, deallocatorContext unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer

JSObjectMakeArrayBufferWithBytesNoCopy calls raw.JSObjectMakeArrayBufferWithBytesNoCopy (C function JSObjectMakeArrayBufferWithBytesNoCopy).

func JSObjectMakeConstructor

func JSObjectMakeConstructor(ctx unsafe.Pointer, jsClass unsafe.Pointer, callAsConstructor unsafe.Pointer) unsafe.Pointer

JSObjectMakeConstructor calls raw.JSObjectMakeConstructor (C function JSObjectMakeConstructor).

func JSObjectMakeDate

func JSObjectMakeDate(ctx unsafe.Pointer, argumentCount uint, arguments unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer

JSObjectMakeDate calls raw.JSObjectMakeDate (C function JSObjectMakeDate).

func JSObjectMakeDeferredPromise

func JSObjectMakeDeferredPromise(ctx unsafe.Pointer, resolve unsafe.Pointer, reject unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer

JSObjectMakeDeferredPromise calls raw.JSObjectMakeDeferredPromise (C function JSObjectMakeDeferredPromise).

func JSObjectMakeError

func JSObjectMakeError(ctx unsafe.Pointer, argumentCount uint, arguments unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer

JSObjectMakeError calls raw.JSObjectMakeError (C function JSObjectMakeError).

func JSObjectMakeFunction

func JSObjectMakeFunction(ctx unsafe.Pointer, name unsafe.Pointer, parameterCount uint, parameterNames unsafe.Pointer, body unsafe.Pointer, sourceURL unsafe.Pointer, startingLineNumber int, exception unsafe.Pointer) unsafe.Pointer

JSObjectMakeFunction calls raw.JSObjectMakeFunction (C function JSObjectMakeFunction).

func JSObjectMakeFunctionWithCallback

func JSObjectMakeFunctionWithCallback(ctx unsafe.Pointer, name unsafe.Pointer, callAsFunction unsafe.Pointer) unsafe.Pointer

JSObjectMakeFunctionWithCallback calls raw.JSObjectMakeFunctionWithCallback (C function JSObjectMakeFunctionWithCallback).

func JSObjectMakeRegExp

func JSObjectMakeRegExp(ctx unsafe.Pointer, argumentCount uint, arguments unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer

JSObjectMakeRegExp calls raw.JSObjectMakeRegExp (C function JSObjectMakeRegExp).

func JSObjectMakeTypedArray

func JSObjectMakeTypedArray(ctx unsafe.Pointer, arrayType JSTypedArrayType, length uint, exception unsafe.Pointer) unsafe.Pointer

JSObjectMakeTypedArray calls raw.JSObjectMakeTypedArray (C function JSObjectMakeTypedArray).

func JSObjectMakeTypedArrayWithArrayBuffer

func JSObjectMakeTypedArrayWithArrayBuffer(ctx unsafe.Pointer, arrayType JSTypedArrayType, buffer unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer

JSObjectMakeTypedArrayWithArrayBuffer calls raw.JSObjectMakeTypedArrayWithArrayBuffer (C function JSObjectMakeTypedArrayWithArrayBuffer).

func JSObjectMakeTypedArrayWithArrayBufferAndOffset

func JSObjectMakeTypedArrayWithArrayBufferAndOffset(ctx unsafe.Pointer, arrayType JSTypedArrayType, buffer unsafe.Pointer, byteOffset uint, length uint, exception unsafe.Pointer) unsafe.Pointer

JSObjectMakeTypedArrayWithArrayBufferAndOffset calls raw.JSObjectMakeTypedArrayWithArrayBufferAndOffset (C function JSObjectMakeTypedArrayWithArrayBufferAndOffset).

func JSObjectMakeTypedArrayWithBytesNoCopy

func JSObjectMakeTypedArrayWithBytesNoCopy(ctx unsafe.Pointer, arrayType JSTypedArrayType, bytes_ unsafe.Pointer, byteLength uint, bytesDeallocator unsafe.Pointer, deallocatorContext unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer

JSObjectMakeTypedArrayWithBytesNoCopy calls raw.JSObjectMakeTypedArrayWithBytesNoCopy (C function JSObjectMakeTypedArrayWithBytesNoCopy).

func JSObjectSetPrivate

func JSObjectSetPrivate(object unsafe.Pointer, data unsafe.Pointer) bool

JSObjectSetPrivate calls raw.JSObjectSetPrivate (C function JSObjectSetPrivate).

func JSObjectSetProperty

func JSObjectSetProperty(ctx unsafe.Pointer, object unsafe.Pointer, propertyName unsafe.Pointer, value unsafe.Pointer, attributes uint, exception unsafe.Pointer)

JSObjectSetProperty calls raw.JSObjectSetProperty (C function JSObjectSetProperty).

func JSObjectSetPropertyAtIndex

func JSObjectSetPropertyAtIndex(ctx unsafe.Pointer, object unsafe.Pointer, propertyIndex uint, value unsafe.Pointer, exception unsafe.Pointer)

JSObjectSetPropertyAtIndex calls raw.JSObjectSetPropertyAtIndex (C function JSObjectSetPropertyAtIndex).

func JSObjectSetPropertyForKey

func JSObjectSetPropertyForKey(ctx unsafe.Pointer, object unsafe.Pointer, propertyKey unsafe.Pointer, value unsafe.Pointer, attributes uint, exception unsafe.Pointer)

JSObjectSetPropertyForKey calls raw.JSObjectSetPropertyForKey (C function JSObjectSetPropertyForKey).

func JSObjectSetPrototype

func JSObjectSetPrototype(ctx unsafe.Pointer, object unsafe.Pointer, value unsafe.Pointer)

JSObjectSetPrototype calls raw.JSObjectSetPrototype (C function JSObjectSetPrototype).

func JSPropertyNameAccumulatorAddName

func JSPropertyNameAccumulatorAddName(accumulator unsafe.Pointer, propertyName unsafe.Pointer)

JSPropertyNameAccumulatorAddName calls raw.JSPropertyNameAccumulatorAddName (C function JSPropertyNameAccumulatorAddName).

func JSPropertyNameArrayGetCount

func JSPropertyNameArrayGetCount(array unsafe.Pointer) uint

JSPropertyNameArrayGetCount calls raw.JSPropertyNameArrayGetCount (C function JSPropertyNameArrayGetCount).

func JSPropertyNameArrayGetNameAtIndex

func JSPropertyNameArrayGetNameAtIndex(array unsafe.Pointer, index uint) unsafe.Pointer

JSPropertyNameArrayGetNameAtIndex calls raw.JSPropertyNameArrayGetNameAtIndex (C function JSPropertyNameArrayGetNameAtIndex).

func JSPropertyNameArrayRelease

func JSPropertyNameArrayRelease(array unsafe.Pointer)

JSPropertyNameArrayRelease calls raw.JSPropertyNameArrayRelease (C function JSPropertyNameArrayRelease).

func JSPropertyNameArrayRetain

func JSPropertyNameArrayRetain(array unsafe.Pointer) unsafe.Pointer

JSPropertyNameArrayRetain calls raw.JSPropertyNameArrayRetain (C function JSPropertyNameArrayRetain).

func JSStringCopyCFString

func JSStringCopyCFString(alloc unsafe.Pointer, string_ unsafe.Pointer) unsafe.Pointer

JSStringCopyCFString calls raw.JSStringCopyCFString (C function JSStringCopyCFString).

func JSStringCreateWithCFString

func JSStringCreateWithCFString(string_ unsafe.Pointer) unsafe.Pointer

JSStringCreateWithCFString calls raw.JSStringCreateWithCFString (C function JSStringCreateWithCFString).

func JSStringCreateWithCharacters

func JSStringCreateWithCharacters(chars *uint16, numChars uint) unsafe.Pointer

JSStringCreateWithCharacters calls raw.JSStringCreateWithCharacters (C function JSStringCreateWithCharacters).

func JSStringCreateWithUTF8CString

func JSStringCreateWithUTF8CString(string_ string) unsafe.Pointer

JSStringCreateWithUTF8CString calls raw.JSStringCreateWithUTF8CString (C function JSStringCreateWithUTF8CString).

func JSStringGetCharactersPtr

func JSStringGetCharactersPtr(string_ unsafe.Pointer) *uint16

JSStringGetCharactersPtr calls raw.JSStringGetCharactersPtr (C function JSStringGetCharactersPtr).

func JSStringGetLength

func JSStringGetLength(string_ unsafe.Pointer) uint

JSStringGetLength calls raw.JSStringGetLength (C function JSStringGetLength).

func JSStringGetMaximumUTF8CStringSize

func JSStringGetMaximumUTF8CStringSize(string_ unsafe.Pointer) uint

JSStringGetMaximumUTF8CStringSize calls raw.JSStringGetMaximumUTF8CStringSize (C function JSStringGetMaximumUTF8CStringSize).

func JSStringGetUTF8CString

func JSStringGetUTF8CString(string_ unsafe.Pointer, buffer string, bufferSize uint) uint

JSStringGetUTF8CString calls raw.JSStringGetUTF8CString (C function JSStringGetUTF8CString).

func JSStringIsEqual

func JSStringIsEqual(a unsafe.Pointer, b unsafe.Pointer) bool

JSStringIsEqual calls raw.JSStringIsEqual (C function JSStringIsEqual).

func JSStringIsEqualToUTF8CString

func JSStringIsEqualToUTF8CString(a unsafe.Pointer, b string) bool

JSStringIsEqualToUTF8CString calls raw.JSStringIsEqualToUTF8CString (C function JSStringIsEqualToUTF8CString).

func JSStringRelease

func JSStringRelease(string_ unsafe.Pointer)

JSStringRelease calls raw.JSStringRelease (C function JSStringRelease).

func JSStringRetain

func JSStringRetain(string_ unsafe.Pointer) unsafe.Pointer

JSStringRetain calls raw.JSStringRetain (C function JSStringRetain).

func JSValueCreateJSONString

func JSValueCreateJSONString(ctx unsafe.Pointer, value unsafe.Pointer, indent uint, exception unsafe.Pointer) unsafe.Pointer

JSValueCreateJSONString calls raw.JSValueCreateJSONString (C function JSValueCreateJSONString).

func JSValueIsArray

func JSValueIsArray(ctx unsafe.Pointer, value unsafe.Pointer) bool

JSValueIsArray calls raw.JSValueIsArray (C function JSValueIsArray).

func JSValueIsBigInt

func JSValueIsBigInt(ctx unsafe.Pointer, value unsafe.Pointer) bool

JSValueIsBigInt calls raw.JSValueIsBigInt (C function JSValueIsBigInt).

func JSValueIsBoolean

func JSValueIsBoolean(ctx unsafe.Pointer, value unsafe.Pointer) bool

JSValueIsBoolean calls raw.JSValueIsBoolean (C function JSValueIsBoolean).

func JSValueIsDate

func JSValueIsDate(ctx unsafe.Pointer, value unsafe.Pointer) bool

JSValueIsDate calls raw.JSValueIsDate (C function JSValueIsDate).

func JSValueIsEqual

func JSValueIsEqual(ctx unsafe.Pointer, a unsafe.Pointer, b unsafe.Pointer, exception unsafe.Pointer) bool

JSValueIsEqual calls raw.JSValueIsEqual (C function JSValueIsEqual).

func JSValueIsInstanceOfConstructor

func JSValueIsInstanceOfConstructor(ctx unsafe.Pointer, value unsafe.Pointer, constructor unsafe.Pointer, exception unsafe.Pointer) bool

JSValueIsInstanceOfConstructor calls raw.JSValueIsInstanceOfConstructor (C function JSValueIsInstanceOfConstructor).

func JSValueIsNull

func JSValueIsNull(ctx unsafe.Pointer, value unsafe.Pointer) bool

JSValueIsNull calls raw.JSValueIsNull (C function JSValueIsNull).

func JSValueIsNumber

func JSValueIsNumber(ctx unsafe.Pointer, value unsafe.Pointer) bool

JSValueIsNumber calls raw.JSValueIsNumber (C function JSValueIsNumber).

func JSValueIsObject

func JSValueIsObject(ctx unsafe.Pointer, value unsafe.Pointer) bool

JSValueIsObject calls raw.JSValueIsObject (C function JSValueIsObject).

func JSValueIsObjectOfClass

func JSValueIsObjectOfClass(ctx unsafe.Pointer, value unsafe.Pointer, jsClass unsafe.Pointer) bool

JSValueIsObjectOfClass calls raw.JSValueIsObjectOfClass (C function JSValueIsObjectOfClass).

func JSValueIsStrictEqual

func JSValueIsStrictEqual(ctx unsafe.Pointer, a unsafe.Pointer, b unsafe.Pointer) bool

JSValueIsStrictEqual calls raw.JSValueIsStrictEqual (C function JSValueIsStrictEqual).

func JSValueIsString

func JSValueIsString(ctx unsafe.Pointer, value unsafe.Pointer) bool

JSValueIsString calls raw.JSValueIsString (C function JSValueIsString).

func JSValueIsSymbol

func JSValueIsSymbol(ctx unsafe.Pointer, value unsafe.Pointer) bool

JSValueIsSymbol calls raw.JSValueIsSymbol (C function JSValueIsSymbol).

func JSValueIsUndefined

func JSValueIsUndefined(ctx unsafe.Pointer, value unsafe.Pointer) bool

JSValueIsUndefined calls raw.JSValueIsUndefined (C function JSValueIsUndefined).

func JSValueMakeBoolean

func JSValueMakeBoolean(ctx unsafe.Pointer, boolean bool) unsafe.Pointer

JSValueMakeBoolean calls raw.JSValueMakeBoolean (C function JSValueMakeBoolean).

func JSValueMakeFromJSONString

func JSValueMakeFromJSONString(ctx unsafe.Pointer, string_ unsafe.Pointer) unsafe.Pointer

JSValueMakeFromJSONString calls raw.JSValueMakeFromJSONString (C function JSValueMakeFromJSONString).

func JSValueMakeNull

func JSValueMakeNull(ctx unsafe.Pointer) unsafe.Pointer

JSValueMakeNull calls raw.JSValueMakeNull (C function JSValueMakeNull).

func JSValueMakeNumber

func JSValueMakeNumber(ctx unsafe.Pointer, number float64) unsafe.Pointer

JSValueMakeNumber calls raw.JSValueMakeNumber (C function JSValueMakeNumber).

func JSValueMakeString

func JSValueMakeString(ctx unsafe.Pointer, string_ unsafe.Pointer) unsafe.Pointer

JSValueMakeString calls raw.JSValueMakeString (C function JSValueMakeString).

func JSValueMakeSymbol

func JSValueMakeSymbol(ctx unsafe.Pointer, description unsafe.Pointer) unsafe.Pointer

JSValueMakeSymbol calls raw.JSValueMakeSymbol (C function JSValueMakeSymbol).

func JSValueMakeUndefined

func JSValueMakeUndefined(ctx unsafe.Pointer) unsafe.Pointer

JSValueMakeUndefined calls raw.JSValueMakeUndefined (C function JSValueMakeUndefined).

func JSValueProtect

func JSValueProtect(ctx unsafe.Pointer, value unsafe.Pointer)

JSValueProtect calls raw.JSValueProtect (C function JSValueProtect).

func JSValueToBoolean

func JSValueToBoolean(ctx unsafe.Pointer, value unsafe.Pointer) bool

JSValueToBoolean calls raw.JSValueToBoolean (C function JSValueToBoolean).

func JSValueToInt32

func JSValueToInt32(ctx unsafe.Pointer, value unsafe.Pointer, exception unsafe.Pointer) int32

JSValueToInt32 calls raw.JSValueToInt32 (C function JSValueToInt32).

func JSValueToInt64

func JSValueToInt64(ctx unsafe.Pointer, value unsafe.Pointer, exception unsafe.Pointer) int64

JSValueToInt64 calls raw.JSValueToInt64 (C function JSValueToInt64).

func JSValueToNumber

func JSValueToNumber(ctx unsafe.Pointer, value unsafe.Pointer, exception unsafe.Pointer) float64

JSValueToNumber calls raw.JSValueToNumber (C function JSValueToNumber).

func JSValueToObject

func JSValueToObject(ctx unsafe.Pointer, value unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer

JSValueToObject calls raw.JSValueToObject (C function JSValueToObject).

func JSValueToStringCopy

func JSValueToStringCopy(ctx unsafe.Pointer, value unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer

JSValueToStringCopy calls raw.JSValueToStringCopy (C function JSValueToStringCopy).

func JSValueToUInt32

func JSValueToUInt32(ctx unsafe.Pointer, value unsafe.Pointer, exception unsafe.Pointer) uint32

JSValueToUInt32 calls raw.JSValueToUInt32 (C function JSValueToUInt32).

func JSValueToUInt64

func JSValueToUInt64(ctx unsafe.Pointer, value unsafe.Pointer, exception unsafe.Pointer) uint64

JSValueToUInt64 calls raw.JSValueToUInt64 (C function JSValueToUInt64).

func JSValueUnprotect

func JSValueUnprotect(ctx unsafe.Pointer, value unsafe.Pointer)

JSValueUnprotect calls raw.JSValueUnprotect (C function JSValueUnprotect).

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context wraps raw.JSContext with a fluent Go API.

func ContextFromID

func ContextFromID(id objc.ID) *Context

ContextFromID adopts an existing object pointer as a Context (nil for 0).

func ContextWithJSGlobalContextRef

func ContextWithJSGlobalContextRef(jsGlobalContextRef unsafe.Pointer) *Context

ContextWithJSGlobalContextRef calls the underlying JSContextContextWithJSGlobalContextRef.

func CurrentContext

func CurrentContext() *Context

CurrentContext calls the underlying JSContextCurrentContext.

func NewContext

func NewContext() *Context

NewContext creates a new Context.

func NewContextWithVirtualMachine

func NewContextWithVirtualMachine(virtualMachine *raw.JSVirtualMachine) *Context

@method @abstract Create a JSContext in the specified virtual machine. @param virtualMachine The JSVirtualMachine in which the context will be created. @result The new context.

NewContextWithVirtualMachine creates a new Context.

func (*Context) EvaluateScript

func (x *Context) EvaluateScript(script string) *Value

@methodgroup Evaluating Scripts @method @abstract Evaluate a string of JavaScript code. @param script A string containing the JavaScript code to evaluate. @result The last value generated by the script.

EvaluateScript calls the underlying EvaluateScript.

func (*Context) EvaluateScriptWithSourceURL

func (x *Context) EvaluateScriptWithSourceURL(script string, sourceURL string) *Value

@method @abstract Evaluate a string of JavaScript code, with a URL for the script's source file. @param script A string containing the JavaScript code to evaluate. @param sourceURL A URL for the script's source file. Used by debuggers and when reporting exceptions. This parameter is informative only: it does not change the behavior of the script. @result The last value generated by the script.

EvaluateScriptWithSourceURL calls the underlying EvaluateScriptWithSourceURL.

func (*Context) Exception

func (x *Context) Exception() *Value

@property @discussion The <code>exception</code> property may be used to throw an exception to JavaScript. Before a callback is made from JavaScript to an Objective-C block or method, the prior value of the exception property will be preserved and the property will be set to nil. After the callback has completed the new value of the exception property will be read, and prior value restored. If the new value of exception is not nil, the callback will result in that value being thrown. This property may also be used to check for uncaught exceptions arising from API function calls (since the default behaviour of <code>exceptionHandler</code> is to assign an uncaught exception to this property).

Exception calls the underlying Exception.

func (*Context) ExceptionHandler

func (x *Context) ExceptionHandler() objc.Block

@property @discussion If a call to an API function results in an uncaught JavaScript exception, the <code>exceptionHandler</code> block will be invoked. The default implementation for the exception handler will store the exception to the exception property on context. As a consequence the default behaviour is for uncaught exceptions occurring within a callback from JavaScript to be rethrown upon return. Setting this value to nil will cause all exceptions occurring within a callback from JavaScript to be silently caught.

ExceptionHandler calls the underlying ExceptionHandler.

func (*Context) GlobalObject

func (x *Context) GlobalObject() *Value

@property @abstract Get the global object of the context. @discussion This method retrieves the global object of the JavaScript execution context. Instances of JSContext originating from WebKit will return a reference to the WindowProxy object. @result The global object.

GlobalObject calls the underlying GlobalObject.

func (*Context) ID

func (x *Context) ID() objc.ID

ID returns the underlying Objective-C object pointer (objc.ID), for passing to C APIs that take an object or CFTypeRef pointer.

func (*Context) IsInspectable

func (x *Context) IsInspectable() bool

@property @discussion Controls whether this @link JSContext @/link is inspectable in Web Inspector. The default value is NO.

IsInspectable calls the underlying IsInspectable.

func (*Context) JSGlobalContextRef

func (x *Context) JSGlobalContextRef() unsafe.Pointer

JSGlobalContextRef calls the underlying JSGlobalContextRef.

func (*Context) Name

func (x *Context) Name() string

@property @discussion Name of the JSContext. Exposed when inspecting the context.

Name calls the underlying Name.

func (*Context) ObjectForKeyedSubscript

func (x *Context) ObjectForKeyedSubscript(key objc.ID) *Value

@method @abstract Get a particular property on the global object. @result The JSValue for the global object's property.

ObjectForKeyedSubscript calls the underlying ObjectForKeyedSubscript.

func (*Context) SetException

func (x *Context) SetException(exception *raw.JSValue)

SetException calls the underlying SetException.

func (*Context) SetExceptionHandler

func (x *Context) SetExceptionHandler(exceptionHandler func(*raw.JSContext, *raw.JSValue))

SetExceptionHandler calls the underlying SetExceptionHandler.

func (*Context) SetInspectable

func (x *Context) SetInspectable(inspectable bool)

SetInspectable calls the underlying SetInspectable.

func (*Context) SetName

func (x *Context) SetName(name string)

SetName calls the underlying SetName.

func (*Context) SetObjectForKeyedSubscript

func (x *Context) SetObjectForKeyedSubscript(object objc.ID, key *foundation.NSObject)

@method @abstract Set a particular property on the global object.

SetObjectForKeyedSubscript calls the underlying SetObjectForKeyedSubscript.

func (*Context) Unwrap

func (x *Context) Unwrap() *raw.JSContext

Unwrap returns the underlying raw.JSContext.

func (*Context) VirtualMachine

func (x *Context) VirtualMachine() *VirtualMachine

@property @discussion All instances of JSContext are associated with a JSVirtualMachine.

VirtualMachine calls the underlying VirtualMachine.

func (*Context) WithException

func (x *Context) WithException(exception *Value) *Context

@property @discussion The <code>exception</code> property may be used to throw an exception to JavaScript. Before a callback is made from JavaScript to an Objective-C block or method, the prior value of the exception property will be preserved and the property will be set to nil. After the callback has completed the new value of the exception property will be read, and prior value restored. If the new value of exception is not nil, the callback will result in that value being thrown. This property may also be used to check for uncaught exceptions arising from API function calls (since the default behaviour of <code>exceptionHandler</code> is to assign an uncaught exception to this property).

WithException sets the exception property and returns the receiver for chaining.

func (*Context) WithExceptionHandler

func (x *Context) WithExceptionHandler(exceptionHandler func(*raw.JSContext, *raw.JSValue)) *Context

@property @discussion If a call to an API function results in an uncaught JavaScript exception, the <code>exceptionHandler</code> block will be invoked. The default implementation for the exception handler will store the exception to the exception property on context. As a consequence the default behaviour is for uncaught exceptions occurring within a callback from JavaScript to be rethrown upon return. Setting this value to nil will cause all exceptions occurring within a callback from JavaScript to be silently caught.

WithExceptionHandler sets the exceptionHandler property and returns the receiver for chaining.

func (*Context) WithInspectable

func (x *Context) WithInspectable(inspectable bool) *Context

@property @discussion Controls whether this @link JSContext @/link is inspectable in Web Inspector. The default value is NO.

WithInspectable sets the inspectable property and returns the receiver for chaining.

func (*Context) WithName

func (x *Context) WithName(name string) *Context

@property @discussion Name of the JSContext. Exposed when inspecting the context.

WithName sets the name property and returns the receiver for chaining.

type Contextable

type Contextable interface {
	Unwrap() *raw.JSContext
	WithException(exception *Value) *Context
	WithExceptionHandler(exceptionHandler func(*raw.JSContext, *raw.JSValue)) *Context
	WithName(name string) *Context
	WithInspectable(inspectable bool) *Context
	EvaluateScript(script string) *Value
	EvaluateScriptWithSourceURL(script string, sourceURL string) *Value
	GlobalObject() *Value
	Exception() *Value
	SetException(exception *raw.JSValue)
	ExceptionHandler() objc.Block
	SetExceptionHandler(exceptionHandler func(*raw.JSContext, *raw.JSValue))
	VirtualMachine() *VirtualMachine
	Name() string
	SetName(name string)
	IsInspectable() bool
	SetInspectable(inspectable bool)
	ObjectForKeyedSubscript(key objc.ID) *Value
	SetObjectForKeyedSubscript(object objc.ID, key *foundation.NSObject)
	JSGlobalContextRef() unsafe.Pointer
}

Contextable is the interface implemented by Context, for mocking and DI.

type JSRelationCondition added in v0.5.0

type JSRelationCondition int64
const (
	KJSRelationConditionUndefined   JSRelationCondition = 0
	KJSRelationConditionEqual       JSRelationCondition = 1
	KJSRelationConditionGreaterThan JSRelationCondition = 2
	KJSRelationConditionLessThan    JSRelationCondition = 3
)

func JSValueCompare

func JSValueCompare(ctx unsafe.Pointer, left unsafe.Pointer, right unsafe.Pointer, exception unsafe.Pointer) JSRelationCondition

JSValueCompare calls raw.JSValueCompare (C function JSValueCompare).

func JSValueCompareDouble

func JSValueCompareDouble(ctx unsafe.Pointer, left unsafe.Pointer, right float64, exception unsafe.Pointer) JSRelationCondition

JSValueCompareDouble calls raw.JSValueCompareDouble (C function JSValueCompareDouble).

func JSValueCompareInt64

func JSValueCompareInt64(ctx unsafe.Pointer, left unsafe.Pointer, right int64, exception unsafe.Pointer) JSRelationCondition

JSValueCompareInt64 calls raw.JSValueCompareInt64 (C function JSValueCompareInt64).

func JSValueCompareUInt64

func JSValueCompareUInt64(ctx unsafe.Pointer, left unsafe.Pointer, right uint64, exception unsafe.Pointer) JSRelationCondition

JSValueCompareUInt64 calls raw.JSValueCompareUInt64 (C function JSValueCompareUInt64).

func (JSRelationCondition) String added in v0.5.0

func (e JSRelationCondition) String() string

type JSType added in v0.5.0

type JSType int64

@enum JSType @abstract A constant identifying the type of a JSValue. @constant kJSTypeUndefined The unique undefined value. @constant kJSTypeNull The unique null value. @constant kJSTypeBoolean A primitive boolean value, one of true or false. @constant kJSTypeNumber A primitive number value. @constant kJSTypeString A primitive string value. @constant kJSTypeObject An object value (meaning that this JSValueRef is a JSObjectRef). @constant kJSTypeSymbol A primitive symbol value. @constant kJSTypeBigInt A primitive BigInt value.

const (
	KJSTypeUndefined JSType = 0
	KJSTypeNull      JSType = 1
	KJSTypeBoolean   JSType = 2
	KJSTypeNumber    JSType = 3
	KJSTypeString    JSType = 4
	KJSTypeObject    JSType = 5
	KJSTypeSymbol    JSType = 6
	KJSTypeBigInt    JSType = 7
)

func JSValueGetType

func JSValueGetType(ctx unsafe.Pointer, value unsafe.Pointer) JSType

JSValueGetType calls raw.JSValueGetType (C function JSValueGetType).

func (JSType) String added in v0.5.0

func (e JSType) String() string

type JSTypedArrayType added in v0.5.0

type JSTypedArrayType int64

@enum JSTypedArrayType @abstract A constant identifying the Typed Array type of a JSObjectRef. @constant kJSTypedArrayTypeInt8Array Int8Array @constant kJSTypedArrayTypeInt16Array Int16Array @constant kJSTypedArrayTypeInt32Array Int32Array @constant kJSTypedArrayTypeUint8Array Uint8Array @constant kJSTypedArrayTypeUint8ClampedArray Uint8ClampedArray @constant kJSTypedArrayTypeUint16Array Uint16Array @constant kJSTypedArrayTypeUint32Array Uint32Array @constant kJSTypedArrayTypeFloat32Array Float32Array @constant kJSTypedArrayTypeFloat64Array Float64Array @constant kJSTypedArrayTypeBigInt64Array BigInt64Array @constant kJSTypedArrayTypeBigUint64Array BigUint64Array @constant kJSTypedArrayTypeArrayBuffer ArrayBuffer @constant kJSTypedArrayTypeNone Not a Typed Array

const (
	KJSTypedArrayTypeInt8Array         JSTypedArrayType = 0
	KJSTypedArrayTypeInt16Array        JSTypedArrayType = 1
	KJSTypedArrayTypeInt32Array        JSTypedArrayType = 2
	KJSTypedArrayTypeUint8Array        JSTypedArrayType = 3
	KJSTypedArrayTypeUint8ClampedArray JSTypedArrayType = 4
	KJSTypedArrayTypeUint16Array       JSTypedArrayType = 5
	KJSTypedArrayTypeUint32Array       JSTypedArrayType = 6
	KJSTypedArrayTypeFloat32Array      JSTypedArrayType = 7
	KJSTypedArrayTypeFloat64Array      JSTypedArrayType = 8
	KJSTypedArrayTypeArrayBuffer       JSTypedArrayType = 9
	KJSTypedArrayTypeNone              JSTypedArrayType = 10
	KJSTypedArrayTypeBigInt64Array     JSTypedArrayType = 11
	KJSTypedArrayTypeBigUint64Array    JSTypedArrayType = 12
)

func JSValueGetTypedArrayType

func JSValueGetTypedArrayType(ctx unsafe.Pointer, value unsafe.Pointer, exception unsafe.Pointer) JSTypedArrayType

JSValueGetTypedArrayType calls raw.JSValueGetTypedArrayType (C function JSValueGetTypedArrayType).

func (JSTypedArrayType) String added in v0.5.0

func (e JSTypedArrayType) String() string

type ManagedValue

type ManagedValue struct {
	// contains filtered or unexported fields
}

ManagedValue wraps raw.JSManagedValue with a fluent Go API.

func ManagedValueFromID

func ManagedValueFromID(id objc.ID) *ManagedValue

ManagedValueFromID adopts an existing object pointer as a ManagedValue (nil for 0).

func ManagedValueWithValue

func ManagedValueWithValue(value *raw.JSValue) *ManagedValue

ManagedValueWithValue calls the underlying JSManagedValueManagedValueWithValue.

func ManagedValueWithValueAndOwner

func ManagedValueWithValueAndOwner(value *raw.JSValue, owner objc.ID) *ManagedValue

ManagedValueWithValueAndOwner calls the underlying JSManagedValueManagedValueWithValueAndOwner.

func NewManagedValueWithValue

func NewManagedValueWithValue(value *raw.JSValue) *ManagedValue

@method @abstract Create a JSManagedValue. @result The new JSManagedValue.

NewManagedValueWithValue creates a new ManagedValue.

func (*ManagedValue) ID

func (x *ManagedValue) ID() objc.ID

ID returns the underlying Objective-C object pointer (objc.ID), for passing to C APIs that take an object or CFTypeRef pointer.

func (*ManagedValue) Unwrap

func (x *ManagedValue) Unwrap() *raw.JSManagedValue

Unwrap returns the underlying raw.JSManagedValue.

func (*ManagedValue) Value

func (x *ManagedValue) Value() *Value

Value calls the underlying Value.

type ManagedValueable

type ManagedValueable interface {
	Unwrap() *raw.JSManagedValue
	Value() *Value
}

ManagedValueable is the interface implemented by ManagedValue, for mocking and DI.

type Value

type Value struct {
	// contains filtered or unexported fields
}

Value wraps raw.JSValue with a fluent Go API.

func CurrentCallee

func CurrentCallee() *Value

CurrentCallee calls the underlying JSContextCurrentCallee.

func CurrentThis

func CurrentThis() *Value

CurrentThis calls the underlying JSContextCurrentThis.

func NewValue

func NewValue() *Value

NewValue creates a new Value.

func ValueFromID

func ValueFromID(id objc.ID) *Value

ValueFromID adopts an existing object pointer as a Value (nil for 0).

func ValueWithBoolInContext

func ValueWithBoolInContext(value bool, context_ *raw.JSContext) *Value

ValueWithBoolInContext calls the underlying JSValueValueWithBoolInContext.

func ValueWithDoubleInContext

func ValueWithDoubleInContext(value float64, context_ *raw.JSContext) *Value

ValueWithDoubleInContext calls the underlying JSValueValueWithDoubleInContext.

func ValueWithInt32InContext

func ValueWithInt32InContext(value int32, context_ *raw.JSContext) *Value

ValueWithInt32InContext calls the underlying JSValueValueWithInt32InContext.

func ValueWithJSValueRefInContext

func ValueWithJSValueRefInContext(value unsafe.Pointer, context_ *raw.JSContext) *Value

ValueWithJSValueRefInContext calls the underlying JSValueValueWithJSValueRefInContext.

func ValueWithNewArrayInContext

func ValueWithNewArrayInContext(context_ *raw.JSContext) *Value

ValueWithNewArrayInContext calls the underlying JSValueValueWithNewArrayInContext.

func ValueWithNewBigIntFromDoubleInContext

func ValueWithNewBigIntFromDoubleInContext(value float64, context_ *raw.JSContext) *Value

ValueWithNewBigIntFromDoubleInContext calls the underlying JSValueValueWithNewBigIntFromDoubleInContext.

func ValueWithNewBigIntFromInt64InContext

func ValueWithNewBigIntFromInt64InContext(int64 int64, context_ *raw.JSContext) *Value

ValueWithNewBigIntFromInt64InContext calls the underlying JSValueValueWithNewBigIntFromInt64InContext.

func ValueWithNewBigIntFromStringInContext

func ValueWithNewBigIntFromStringInContext(string_ string, context_ *raw.JSContext) *Value

ValueWithNewBigIntFromStringInContext calls the underlying JSValueValueWithNewBigIntFromStringInContext.

func ValueWithNewBigIntFromUInt64InContext

func ValueWithNewBigIntFromUInt64InContext(uint64 uint64, context_ *raw.JSContext) *Value

ValueWithNewBigIntFromUInt64InContext calls the underlying JSValueValueWithNewBigIntFromUInt64InContext.

func ValueWithNewErrorFromMessageInContext

func ValueWithNewErrorFromMessageInContext(message string, context_ *raw.JSContext) *Value

ValueWithNewErrorFromMessageInContext calls the underlying JSValueValueWithNewErrorFromMessageInContext.

func ValueWithNewObjectInContext

func ValueWithNewObjectInContext(context_ *raw.JSContext) *Value

ValueWithNewObjectInContext calls the underlying JSValueValueWithNewObjectInContext.

func ValueWithNewPromiseInContextFromExecutor

func ValueWithNewPromiseInContextFromExecutor(context_ *raw.JSContext, callback func(*raw.JSValue, *raw.JSValue)) *Value

ValueWithNewPromiseInContextFromExecutor calls the underlying JSValueValueWithNewPromiseInContextFromExecutor.

func ValueWithNewPromiseRejectedWithReasonInContext

func ValueWithNewPromiseRejectedWithReasonInContext(reason objc.ID, context_ *raw.JSContext) *Value

ValueWithNewPromiseRejectedWithReasonInContext calls the underlying JSValueValueWithNewPromiseRejectedWithReasonInContext.

func ValueWithNewPromiseResolvedWithResultInContext

func ValueWithNewPromiseResolvedWithResultInContext(result objc.ID, context_ *raw.JSContext) *Value

ValueWithNewPromiseResolvedWithResultInContext calls the underlying JSValueValueWithNewPromiseResolvedWithResultInContext.

func ValueWithNewRegularExpressionFromPatternFlagsInContext

func ValueWithNewRegularExpressionFromPatternFlagsInContext(pattern string, flags string, context_ *raw.JSContext) *Value

ValueWithNewRegularExpressionFromPatternFlagsInContext calls the underlying JSValueValueWithNewRegularExpressionFromPatternFlagsInContext.

func ValueWithNewSymbolFromDescriptionInContext

func ValueWithNewSymbolFromDescriptionInContext(description string, context_ *raw.JSContext) *Value

ValueWithNewSymbolFromDescriptionInContext calls the underlying JSValueValueWithNewSymbolFromDescriptionInContext.

func ValueWithNullInContext

func ValueWithNullInContext(context_ *raw.JSContext) *Value

ValueWithNullInContext calls the underlying JSValueValueWithNullInContext.

func ValueWithObjectInContext

func ValueWithObjectInContext(value objc.ID, context_ *raw.JSContext) *Value

ValueWithObjectInContext calls the underlying JSValueValueWithObjectInContext.

func ValueWithPointInContext

func ValueWithPointInContext(point corefoundation.CGPoint, context_ *raw.JSContext) *Value

ValueWithPointInContext calls the underlying JSValueValueWithPointInContext.

func ValueWithRangeInContext

func ValueWithRangeInContext(range_ foundation.NSRange, context_ *raw.JSContext) *Value

ValueWithRangeInContext calls the underlying JSValueValueWithRangeInContext.

func ValueWithRectInContext

func ValueWithRectInContext(rect corefoundation.CGRect, context_ *raw.JSContext) *Value

ValueWithRectInContext calls the underlying JSValueValueWithRectInContext.

func ValueWithSizeInContext

func ValueWithSizeInContext(size corefoundation.CGSize, context_ *raw.JSContext) *Value

ValueWithSizeInContext calls the underlying JSValueValueWithSizeInContext.

func ValueWithUInt32InContext

func ValueWithUInt32InContext(value uint32, context_ *raw.JSContext) *Value

ValueWithUInt32InContext calls the underlying JSValueValueWithUInt32InContext.

func ValueWithUndefinedInContext

func ValueWithUndefinedInContext(context_ *raw.JSContext) *Value

ValueWithUndefinedInContext calls the underlying JSValueValueWithUndefinedInContext.

func (*Value) CallWithArguments

func (x *Value) CallWithArguments(arguments *foundation.NSArray[objc.ID]) *Value

@methodgroup Calling Functions and Constructors @method @abstract Invoke a JSValue as a function. @discussion In JavaScript, if a function doesn't explicitly return a value then it implicitly returns the JavaScript value <code>undefined</code>. @param arguments The arguments to pass to the function. @result The return value of the function call.

CallWithArguments calls the underlying CallWithArguments.

func (*Value) CompareDouble

func (x *Value) CompareDouble(other float64) JSRelationCondition

@method @abstract Compare a JSValue with a double. @other The double to compare with. @result A value of JSRelationCondition, a kJSRelationConditionUndefined is returned if an exception is thrown. @discussion The JSValue is converted to a double according to the rules specified by the JavaScript language then compared with <code>other</code>.

CompareDouble calls the underlying CompareDouble.

func (*Value) CompareInt64

func (x *Value) CompareInt64(other int64) JSRelationCondition

@method @abstract Compare a JSValue with a <code>int64_t</code>. @other The <code>int64_t</code> to compare with. @result A value of JSRelationCondition, a kJSRelationConditionUndefined is returned if an exception is thrown. @discussion The JSValue is converted to an integer according to the rules specified by the JavaScript language then compared with <code>other</code>.

CompareInt64 calls the underlying CompareInt64.

func (*Value) CompareJSValue

func (x *Value) CompareJSValue(other *raw.JSValue) JSRelationCondition

@method @abstract Compare two JSValues. @other The JSValue to compare with. @result A value of JSRelationCondition, a kJSRelationConditionUndefined is returned if an exception is thrown. @discussion The result is computed by comparing the results of JavaScript's <code>==</code>, <code><</code>, and <code>></code> operators. If either <code>self</code> or <code>other</code> is (or would coerce to) <code>NaN</code> in JavaScript, then the result is kJSRelationConditionUndefined.

CompareJSValue calls the underlying CompareJSValue.

func (*Value) CompareUInt64

func (x *Value) CompareUInt64(other uint64) JSRelationCondition

@method @abstract Compare a JSValue with a <code>uint64_t</code>. @other The <code>uint64_t</code> to compare with. @result A value of JSRelationCondition, a kJSRelationConditionUndefined is returned if an exception is thrown. @discussion The JSValue is converted to an integer according to the rules specified by the JavaScript language then compared with <code>other</code>.

CompareUInt64 calls the underlying CompareUInt64.

func (*Value) ConstructWithArguments

func (x *Value) ConstructWithArguments(arguments *foundation.NSArray[objc.ID]) *Value

@method @abstract Invoke a JSValue as a constructor. @discussion This is equivalent to using the <code>new</code> syntax in JavaScript. @param arguments The arguments to pass to the constructor. @result The return value of the constructor call.

ConstructWithArguments calls the underlying ConstructWithArguments.

func (*Value) Context

func (x *Value) Context() *Context

@property @abstract The JSContext that this value originates from.

Context calls the underlying Context.

func (*Value) DefinePropertyDescriptor

func (x *Value) DefinePropertyDescriptor(property objc.ID, descriptor objc.ID)

@method @abstract Define properties with custom descriptors on JSValues. @discussion This method may be used to create a data or accessor property on an object. This method operates in accordance with the Object.defineProperty method in the JavaScript language. Starting with macOS 10.15 and iOS 13, 'property' can be any 'id' and will be converted to a JSValue using the conversion rules of <code>valueWithObject:inContext:</code>. Prior to macOS 10.15 and iOS 13, 'property' was expected to be an NSString *.

DefinePropertyDescriptor calls the underlying DefinePropertyDescriptor.

func (*Value) DeleteProperty

func (x *Value) DeleteProperty(property objc.ID) bool

@method @abstract Delete a property from a JSValue. @result YES if deletion is successful, NO otherwise. @discussion Corresponds to the JavaScript operation <code>delete object[property]</code>. Starting with macOS 10.15 and iOS 13, 'property' can be any 'id' and will be converted to a JSValue using the conversion rules of <code>valueWithObject:inContext:</code>. Prior to macOS 10.15 and iOS 13, 'property' was expected to be an NSString *.

DeleteProperty calls the underlying DeleteProperty.

func (*Value) HasProperty

func (x *Value) HasProperty(property objc.ID) bool

@method @abstract Check if a JSValue has a property. @discussion This method has the same function as the JavaScript operator <code>in</code>. @result Returns YES if property is present on the value. @discussion Corresponds to the JavaScript operation <code>property in object</code>. Starting with macOS 10.15 and iOS 13, 'property' can be any 'id' and will be converted to a JSValue using the conversion rules of <code>valueWithObject:inContext:</code>. Prior to macOS 10.15 and iOS 13, 'property' was expected to be an NSString *.

HasProperty calls the underlying HasProperty.

func (*Value) ID

func (x *Value) ID() objc.ID

ID returns the underlying Objective-C object pointer (objc.ID), for passing to C APIs that take an object or CFTypeRef pointer.

func (*Value) InvokeMethodWithArguments

func (x *Value) InvokeMethodWithArguments(method string, arguments *foundation.NSArray[objc.ID]) *Value

@method @abstract Invoke a method on a JSValue. @discussion Accesses the property named <code>method</code> from this value and calls the resulting value as a function, passing this JSValue as the <code>this</code> value along with the specified arguments. @param method The name of the method to be invoked. @param arguments The arguments to pass to the method. @result The return value of the method call.

InvokeMethodWithArguments calls the underlying InvokeMethodWithArguments.

func (*Value) IsArray

func (x *Value) IsArray() bool

@property @abstract Check if a JSValue is an array.

IsArray calls the underlying IsArray.

func (*Value) IsBigInt

func (x *Value) IsBigInt() bool

@property @abstract Check if a JSValue is a BigInt.

IsBigInt calls the underlying IsBigInt.

func (*Value) IsBoolean

func (x *Value) IsBoolean() bool

@property @abstract Check if a JSValue is a boolean.

IsBoolean calls the underlying IsBoolean.

func (*Value) IsDate

func (x *Value) IsDate() bool

@property @abstract Check if a JSValue is a date.

IsDate calls the underlying IsDate.

func (*Value) IsEqualToObject

func (x *Value) IsEqualToObject(value objc.ID) bool

@method @abstract Compare two JSValues using JavaScript's <code>===</code> operator.

IsEqualToObject calls the underlying IsEqualToObject.

func (*Value) IsEqualWithTypeCoercionToObject

func (x *Value) IsEqualWithTypeCoercionToObject(value objc.ID) bool

@method @abstract Compare two JSValues using JavaScript's <code>==</code> operator.

IsEqualWithTypeCoercionToObject calls the underlying IsEqualWithTypeCoercionToObject.

func (*Value) IsInstanceOf

func (x *Value) IsInstanceOf(value objc.ID) bool

@method @abstract Check if a JSValue is an instance of another object. @discussion This method has the same function as the JavaScript operator <code>instanceof</code>. If an object other than a JSValue is passed, it will first be converted according to the aforementioned rules.

IsInstanceOf calls the underlying IsInstanceOf.

func (*Value) IsNull

func (x *Value) IsNull() bool

@property @abstract Check if a JSValue corresponds to the JavaScript value <code>null</code>.

IsNull calls the underlying IsNull.

func (*Value) IsNumber

func (x *Value) IsNumber() bool

@property @abstract Check if a JSValue is a number. @discussion In JavaScript, there is no differentiation between types of numbers. Semantically all numbers behave like doubles except in special cases like bit operations.

IsNumber calls the underlying IsNumber.

func (*Value) IsObject

func (x *Value) IsObject() bool

@property @abstract Check if a JSValue is an object.

IsObject calls the underlying IsObject.

func (*Value) IsString

func (x *Value) IsString() bool

@property @abstract Check if a JSValue is a string.

IsString calls the underlying IsString.

func (*Value) IsSymbol

func (x *Value) IsSymbol() bool

@property @abstract Check if a JSValue is a symbol.

IsSymbol calls the underlying IsSymbol.

func (*Value) IsUndefined

func (x *Value) IsUndefined() bool

@property @abstract Check if a JSValue corresponds to the JavaScript value <code>undefined</code>.

IsUndefined calls the underlying IsUndefined.

func (*Value) JSValueRef

func (x *Value) JSValueRef() unsafe.Pointer

JSValueRef calls the underlying JSValueRef.

func (*Value) ObjectAtIndexedSubscript

func (x *Value) ObjectAtIndexedSubscript(index uint) *Value

ObjectAtIndexedSubscript calls the underlying ObjectAtIndexedSubscript.

func (*Value) ObjectForKeyedSubscript

func (x *Value) ObjectForKeyedSubscript(key objc.ID) *Value

ObjectForKeyedSubscript calls the underlying ObjectForKeyedSubscript.

func (*Value) SetObjectAtIndexedSubscript

func (x *Value) SetObjectAtIndexedSubscript(object objc.ID, index uint)

SetObjectAtIndexedSubscript calls the underlying SetObjectAtIndexedSubscript.

func (*Value) SetObjectForKeyedSubscript

func (x *Value) SetObjectForKeyedSubscript(object objc.ID, key objc.ID)

SetObjectForKeyedSubscript calls the underlying SetObjectForKeyedSubscript.

func (*Value) SetValueAtIndex

func (x *Value) SetValueAtIndex(value objc.ID, index uint)

@method @abstract Set an indexed (numerical) property on a JSValue. @discussion For JSValues that are JavaScript arrays, indices greater than UINT_MAX - 1 will not affect the length of the array.

SetValueAtIndex calls the underlying SetValueAtIndex.

func (*Value) SetValueForProperty

func (x *Value) SetValueForProperty(value objc.ID, property objc.ID)

@method @abstract Set a property on a JSValue. @discussion Corresponds to the JavaScript operation <code>object[property] = value</code>. Starting with macOS 10.15 and iOS 13, 'property' can be any 'id' and will be converted to a JSValue using the conversion rules of <code>valueWithObject:inContext:</code>. Prior to macOS 10.15 and iOS 13, 'property' was expected to be an NSString *.

SetValueForProperty calls the underlying SetValueForProperty.

func (*Value) ToArray

func (x *Value) ToArray() *foundation.NSArray[objc.ID]

@method @abstract Convert a JSValue to a NSArray. @discussion If the value is <code>null</code> or <code>undefined</code> then <code>nil</code> is returned. If the value is not an object then a JavaScript TypeError will be thrown. The property <code>length</code> is read from the object, converted to an unsigned integer, and an NSArray of this size is allocated. Properties corresponding to indices within the array bounds will be copied to the array, with JSValues converted to equivalent Objective-C objects as specified. @result The NSArray containing the recursively converted contents of the converted JavaScript array.

ToArray calls the underlying ToArray.

func (*Value) ToBool

func (x *Value) ToBool() bool

@method @abstract Convert a JSValue to a boolean. @discussion The JSValue is converted to a boolean according to the rules specified by the JavaScript language. @result The boolean result of the conversion.

ToBool calls the underlying ToBool.

func (*Value) ToDate

func (x *Value) ToDate() *foundation.NSDate

@method @abstract Convert a JSValue to a NSDate. @discussion The value is converted to a number representing a time interval since 1970 which is then used to create a new NSDate instance. @result The NSDate created using the converted time interval.

ToDate calls the underlying ToDate.

func (*Value) ToDictionary

func (x *Value) ToDictionary() *foundation.NSDictionary[objc.ID, objc.ID]

@method @abstract Convert a JSValue to a NSDictionary. @discussion If the value is <code>null</code> or <code>undefined</code> then <code>nil</code> is returned. If the value is not an object then a JavaScript TypeError will be thrown. All enumerable properties of the object are copied to the dictionary, with JSValues converted to equivalent Objective-C objects as specified. @result The NSDictionary containing the recursively converted contents of the converted JavaScript object.

ToDictionary calls the underlying ToDictionary.

func (*Value) ToDouble

func (x *Value) ToDouble() float64

@method @abstract Convert a JSValue to a double. @result The double result of the conversion. @discussion Convert the JSValue to a number according to the rules specified by the JavaScript language. Unless the JSValue is a BigInt then this is equivalent to <code>Number(value)</code> in JavaScript.

ToDouble calls the underlying ToDouble.

func (*Value) ToInt32

func (x *Value) ToInt32() int32

@method @abstract Convert a JSValue to an <code>int32_t</code>. @discussion The JSValue is converted to an integer according to the rules specified by the JavaScript language. If the JSValue is a BigInt, then the value is truncated to an <code>int32_t</code>. @result The <code>int32_t</code> result of the conversion.

ToInt32 calls the underlying ToInt32.

func (*Value) ToInt64

func (x *Value) ToInt64() int64

@method @abstract Convert a JSValue to a <code>int64_t</code>. @discussion The JSValue is converted to an integer according to the rules specified by the JavaScript language. If the value is a BigInt, then the value is truncated to an <code>int64_t</code>.

ToInt64 calls the underlying ToInt64.

func (*Value) ToNumber

func (x *Value) ToNumber() *foundation.NSNumber

@method @abstract Convert a JSValue to a NSNumber. @discussion If the JSValue represents a boolean, a NSNumber value of YES or NO will be returned. For all other types, the result is equivalent to <code>Number(value)</code> in JavaScript. @result The NSNumber result of the conversion.

ToNumber calls the underlying ToNumber.

func (*Value) ToObject

func (x *Value) ToObject() objc.ID

@methodgroup Converting to Objective-C Types @discussion When converting between JavaScript values and Objective-C objects a copy is performed. Values of types listed below are copied to the corresponding types on conversion in each direction. For NSDictionaries, entries in the dictionary that are keyed by strings are copied onto a JavaScript object. For dictionaries and arrays, conversion is recursive, with the same object conversion being applied to all entries in the collection. <pre> @textblock Objective-C type | JavaScript type --------------------+--------------------- nil | undefined NSNull | null NSString | string NSNumber | number, boolean NSDictionary | Object object NSArray | Array object NSDate | Date object NSBlock (1) | Function object (1) id (2) | Wrapper object (2) Class (3) | Constructor object (3) @/textblock </pre> (1) Instances of NSBlock with supported arguments types will be presented to JavaScript as a callable Function object. For more information on supported argument types see JSExport.h. If a JavaScript Function originating from an Objective-C block is converted back to an Objective-C object the block will be returned. All other JavaScript functions will be converted in the same manner as a JavaScript object of type Object. (2) For Objective-C instances that do not derive from the set of types listed above, a wrapper object to provide a retaining handle to the Objective-C instance from JavaScript. For more information on these wrapper objects, see JSExport.h. When a JavaScript wrapper object is converted back to Objective-C the Objective-C instance being retained by the wrapper is returned. (3) For Objective-C Class objects a constructor object containing exported class methods will be returned. See JSExport.h for more information on constructor objects. For all methods taking arguments of type id, arguments will be converted into a JavaScript value according to the above conversion. @method @abstract Convert this JSValue to an Objective-C object. @discussion The JSValue is converted to an Objective-C object according to the conversion rules specified above. @result The Objective-C representation of this JSValue.

ToObject calls the underlying ToObject.

func (*Value) ToObjectOfClass

func (x *Value) ToObjectOfClass(expectedClass objc.Class) objc.ID

@method @abstract Convert a JSValue to an Objective-C object of a specific class. @discussion The JSValue is converted to an Objective-C object of the specified Class. If the result is not of the specified Class then <code>nil</code> will be returned. @result An Objective-C object of the specified Class or <code>nil</code>.

ToObjectOfClass calls the underlying ToObjectOfClass.

func (*Value) ToPoint

func (x *Value) ToPoint() corefoundation.CGPoint

@method @abstract Convert a JSValue to a CGPoint. @discussion Reads the properties named <code>x</code> and <code>y</code> from this JSValue, and converts the results to double. @result The new CGPoint.

ToPoint calls the underlying ToPoint.

func (*Value) ToRange

func (x *Value) ToRange() foundation.NSRange

@method @abstract Convert a JSValue to an NSRange. @discussion Reads the properties named <code>location</code> and <code>length</code> from this JSValue and converts the results to double. @result The new NSRange.

ToRange calls the underlying ToRange.

func (*Value) ToRect

func (x *Value) ToRect() corefoundation.CGRect

@method @abstract Convert a JSValue to a CGRect. @discussion Reads the properties named <code>x</code>, <code>y</code>, <code>width</code>, and <code>height</code> from this JSValue and converts the results to double. @result The new CGRect.

ToRect calls the underlying ToRect.

func (*Value) ToSize

func (x *Value) ToSize() corefoundation.CGSize

@method @abstract Convert a JSValue to a CGSize. @discussion Reads the properties named <code>width</code> and <code>height</code> from this JSValue and converts the results to double. @result The new CGSize.

ToSize calls the underlying ToSize.

func (*Value) ToString

func (x *Value) ToString() string

@method @abstract Convert a JSValue to a NSString. @discussion The JSValue is converted to a string according to the rules specified by the JavaScript language. @result The NSString containing the result of the conversion.

ToString calls the underlying ToString.

func (*Value) ToUInt32

func (x *Value) ToUInt32() uint32

@method @abstract Convert a JSValue to a <code>uint32_t</code>. @discussion The JSValue is converted to an integer according to the rules specified by the JavaScript language. If the JSValue is a BigInt, then the value is truncated to a <code>uint32_t</code>. @result The <code>uint32_t</code> result of the conversion.

ToUInt32 calls the underlying ToUInt32.

func (*Value) ToUInt64

func (x *Value) ToUInt64() uint64

@method @abstract Convert a JSValue to a <code>uint64_t</code>. @discussion The JSValue is converted to an integer according to the rules specified by the JavaScript language. If the value is a BigInt, then the value is truncated to a <code>uint64_t</code>.

ToUInt64 calls the underlying ToUInt64.

func (*Value) Unwrap

func (x *Value) Unwrap() *raw.JSValue

Unwrap returns the underlying raw.JSValue.

func (*Value) ValueAtIndex

func (x *Value) ValueAtIndex(index uint) *Value

@method @abstract Access an indexed (numerical) property on a JSValue. @result The JSValue for the property at the specified index. Returns the JavaScript value <code>undefined</code> if no property exists at that index.

ValueAtIndex calls the underlying ValueAtIndex.

func (*Value) ValueForProperty

func (x *Value) ValueForProperty(property objc.ID) *Value

@method @abstract Access a property of a JSValue. @result The JSValue for the requested property or the JSValue <code>undefined</code> if the property does not exist. @discussion Corresponds to the JavaScript operation <code>object[property]</code>. Starting with macOS 10.15 and iOS 13, 'property' can be any 'id' and will be converted to a JSValue using the conversion rules of <code>valueWithObject:inContext:</code>. Prior to macOS 10.15 and iOS 13, 'property' was expected to be an NSString *.

ValueForProperty calls the underlying ValueForProperty.

type Valueable

type Valueable interface {
	Unwrap() *raw.JSValue
	ToObject() objc.ID
	ToObjectOfClass(expectedClass objc.Class) objc.ID
	ToBool() bool
	ToDouble() float64
	ToInt32() int32
	ToUInt32() uint32
	ToInt64() int64
	ToUInt64() uint64
	ToNumber() *foundation.NSNumber
	ToString() string
	ToDate() *foundation.NSDate
	ToArray() *foundation.NSArray[objc.ID]
	ToDictionary() *foundation.NSDictionary[objc.ID, objc.ID]
	IsInstanceOf(value objc.ID) bool
	IsEqualToObject(value objc.ID) bool
	IsEqualWithTypeCoercionToObject(value objc.ID) bool
	CompareJSValue(other *raw.JSValue) JSRelationCondition
	CompareInt64(other int64) JSRelationCondition
	CompareUInt64(other uint64) JSRelationCondition
	CompareDouble(other float64) JSRelationCondition
	CallWithArguments(arguments *foundation.NSArray[objc.ID]) *Value
	ConstructWithArguments(arguments *foundation.NSArray[objc.ID]) *Value
	InvokeMethodWithArguments(method string, arguments *foundation.NSArray[objc.ID]) *Value
	Context() *Context
	IsUndefined() bool
	IsNull() bool
	IsBoolean() bool
	IsNumber() bool
	IsString() bool
	IsObject() bool
	IsArray() bool
	IsDate() bool
	IsSymbol() bool
	IsBigInt() bool
	ToPoint() corefoundation.CGPoint
	ToRange() foundation.NSRange
	ToRect() corefoundation.CGRect
	ToSize() corefoundation.CGSize
	ValueForProperty(property objc.ID) *Value
	SetValueForProperty(value objc.ID, property objc.ID)
	DeleteProperty(property objc.ID) bool
	HasProperty(property objc.ID) bool
	DefinePropertyDescriptor(property objc.ID, descriptor objc.ID)
	ValueAtIndex(index uint) *Value
	SetValueAtIndex(value objc.ID, index uint)
	ObjectForKeyedSubscript(key objc.ID) *Value
	ObjectAtIndexedSubscript(index uint) *Value
	SetObjectForKeyedSubscript(object objc.ID, key objc.ID)
	SetObjectAtIndexedSubscript(object objc.ID, index uint)
	JSValueRef() unsafe.Pointer
}

Valueable is the interface implemented by Value, for mocking and DI.

type VirtualMachine

type VirtualMachine struct {
	// contains filtered or unexported fields
}

VirtualMachine wraps raw.JSVirtualMachine with a fluent Go API.

func NewVirtualMachine

func NewVirtualMachine() *VirtualMachine

NewVirtualMachine creates a new VirtualMachine.

func VirtualMachineFromID

func VirtualMachineFromID(id objc.ID) *VirtualMachine

VirtualMachineFromID adopts an existing object pointer as a VirtualMachine (nil for 0).

func (*VirtualMachine) AddManagedReferenceWithOwner

func (x *VirtualMachine) AddManagedReferenceWithOwner(object objc.ID, owner objc.ID)

@methodgroup Memory Management @method @abstract Notify the JSVirtualMachine of an external object relationship. @discussion Allows clients of JSVirtualMachine to make the JavaScript runtime aware of arbitrary external Objective-C object graphs. The runtime can then use this information to retain any JavaScript values that are referenced from somewhere in said object graph. For correct behavior clients must make their external object graphs reachable from within the JavaScript runtime. If an Objective-C object is reachable from within the JavaScript runtime, all managed references transitively reachable from it as recorded using -addManagedReference:withOwner: will be scanned by the garbage collector. @param object The object that the owner points to. @param owner The object that owns the pointed to object.

AddManagedReferenceWithOwner calls the underlying AddManagedReferenceWithOwner.

func (*VirtualMachine) ID

func (x *VirtualMachine) ID() objc.ID

ID returns the underlying Objective-C object pointer (objc.ID), for passing to C APIs that take an object or CFTypeRef pointer.

func (*VirtualMachine) RemoveManagedReferenceWithOwner

func (x *VirtualMachine) RemoveManagedReferenceWithOwner(object objc.ID, owner objc.ID)

@method @abstract Notify the JSVirtualMachine that a previous object relationship no longer exists. @discussion The JavaScript runtime will continue to scan any references that were reported to it by -addManagedReference:withOwner: until those references are removed. @param object The object that was formerly owned. @param owner The former owner.

RemoveManagedReferenceWithOwner calls the underlying RemoveManagedReferenceWithOwner.

func (*VirtualMachine) Unwrap

func (x *VirtualMachine) Unwrap() *raw.JSVirtualMachine

Unwrap returns the underlying raw.JSVirtualMachine.

type VirtualMachineable

type VirtualMachineable interface {
	Unwrap() *raw.JSVirtualMachine
	AddManagedReferenceWithOwner(object objc.ID, owner objc.ID)
	RemoveManagedReferenceWithOwner(object objc.ID, owner objc.ID)
}

VirtualMachineable is the interface implemented by VirtualMachine, for mocking and DI.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL