Documentation
¶
Overview ¶
Package javascriptcore provides a fluent Go API over the macOS JavaScriptCore framework.
Construction ¶
New… functions create objects; each With… method sets one property and returns its receiver, so configuration calls chain. A <Type>FromID constructor adopts an Objective-C object obtained elsewhere.
Lifecycle ¶
A wrapper releases its Objective-C object automatically once the garbage collector finds it unreachable. Call Release to relinquish the reference deterministically (for objects holding scarce resources); Release is idempotent, and afterwards the wrapper's methods are no-ops returning zero values.
Index ¶
- Constants
- func CurrentArguments() obj.Object
- func JSCheckScriptSyntax(ctx JSContextRef, script JSStringRef, sourceURL JSStringRef, ...) bool
- func JSClassRelease(jsClass JSClassRef)
- func JSContextGroupRelease(group JSContextGroupRef)
- func JSGarbageCollect(ctx JSContextRef)
- func JSGlobalContextIsInspectable(ctx JSGlobalContextRef) bool
- func JSGlobalContextRelease(ctx JSGlobalContextRef)
- func JSGlobalContextSetInspectable(ctx JSGlobalContextRef, inspectable bool)
- func JSGlobalContextSetName(ctx JSGlobalContextRef, name JSStringRef)
- func JSObjectDeleteProperty(ctx JSContextRef, object JSObjectRef, propertyName JSStringRef, ...) bool
- func JSObjectDeletePropertyForKey(ctx JSContextRef, object JSObjectRef, propertyKey JSValueRef, ...) bool
- func JSObjectGetArrayBufferByteLength(ctx JSContextRef, object JSObjectRef, exception unsafe.Pointer) int
- func JSObjectGetArrayBufferBytesPtr(ctx JSContextRef, object JSObjectRef, exception unsafe.Pointer) unsafe.Pointer
- func JSObjectGetPrivate(object JSObjectRef) unsafe.Pointer
- func JSObjectGetTypedArrayByteLength(ctx JSContextRef, object JSObjectRef, exception unsafe.Pointer) int
- func JSObjectGetTypedArrayByteOffset(ctx JSContextRef, object JSObjectRef, exception unsafe.Pointer) int
- func JSObjectGetTypedArrayBytesPtr(ctx JSContextRef, object JSObjectRef, exception unsafe.Pointer) unsafe.Pointer
- func JSObjectGetTypedArrayLength(ctx JSContextRef, object JSObjectRef, exception unsafe.Pointer) int
- func JSObjectHasProperty(ctx JSContextRef, object JSObjectRef, propertyName JSStringRef) bool
- func JSObjectHasPropertyForKey(ctx JSContextRef, object JSObjectRef, propertyKey JSValueRef, ...) bool
- func JSObjectIsConstructor(ctx JSContextRef, object JSObjectRef) bool
- func JSObjectIsFunction(ctx JSContextRef, object JSObjectRef) bool
- func JSObjectSetPrivate(object JSObjectRef, data unsafe.Pointer) bool
- func JSObjectSetProperty(ctx JSContextRef, object JSObjectRef, propertyName JSStringRef, ...)
- func JSObjectSetPropertyAtIndex(ctx JSContextRef, object JSObjectRef, propertyIndex int, value JSValueRef, ...)
- func JSObjectSetPropertyForKey(ctx JSContextRef, object JSObjectRef, propertyKey JSValueRef, value JSValueRef, ...)
- func JSObjectSetPrototype(ctx JSContextRef, object JSObjectRef, value JSValueRef)
- func JSPropertyDescriptorConfigurableKey() obj.Object
- func JSPropertyDescriptorEnumerableKey() obj.Object
- func JSPropertyDescriptorGetKey() obj.Object
- func JSPropertyDescriptorSetKey() obj.Object
- func JSPropertyDescriptorValueKey() obj.Object
- func JSPropertyDescriptorWritableKey() obj.Object
- func JSPropertyNameAccumulatorAddName(accumulator JSPropertyNameAccumulatorRef, propertyName JSStringRef)
- func JSPropertyNameArrayGetCount(array JSPropertyNameArrayRef) int
- func JSPropertyNameArrayRelease(array JSPropertyNameArrayRef)
- func JSStringCopyCFString(alloc corefoundation.CFAllocatorRef, str JSStringRef) corefoundation.CFStringRef
- func JSStringGetCharactersPtr(str JSStringRef) unsafe.Pointer
- func JSStringGetLength(str JSStringRef) int
- func JSStringGetMaximumUTF8CStringSize(str JSStringRef) int
- func JSStringGetUTF8CString(str JSStringRef, buffer string, bufferSize int) int
- func JSStringIsEqual(a JSStringRef, b JSStringRef) bool
- func JSStringIsEqualToUTF8CString(a JSStringRef, b string) bool
- func JSStringRelease(str JSStringRef)
- func JSValueIsArray(ctx JSContextRef, value JSValueRef) bool
- func JSValueIsBigInt(ctx JSContextRef, value JSValueRef) bool
- func JSValueIsBoolean(ctx JSContextRef, value JSValueRef) bool
- func JSValueIsDate(ctx JSContextRef, value JSValueRef) bool
- func JSValueIsEqual(ctx JSContextRef, a JSValueRef, b JSValueRef, exception unsafe.Pointer) bool
- func JSValueIsInstanceOfConstructor(ctx JSContextRef, value JSValueRef, constructor JSObjectRef, ...) bool
- func JSValueIsNull(ctx JSContextRef, value JSValueRef) bool
- func JSValueIsNumber(ctx JSContextRef, value JSValueRef) bool
- func JSValueIsObject(ctx JSContextRef, value JSValueRef) bool
- func JSValueIsObjectOfClass(ctx JSContextRef, value JSValueRef, jsClass JSClassRef) bool
- func JSValueIsStrictEqual(ctx JSContextRef, a JSValueRef, b JSValueRef) bool
- func JSValueIsString(ctx JSContextRef, value JSValueRef) bool
- func JSValueIsSymbol(ctx JSContextRef, value JSValueRef) bool
- func JSValueIsUndefined(ctx JSContextRef, value JSValueRef) bool
- func JSValueProtect(ctx JSContextRef, value JSValueRef)
- func JSValueToBoolean(ctx JSContextRef, value JSValueRef) bool
- func JSValueToInt32(ctx JSContextRef, value JSValueRef, exception unsafe.Pointer) int32
- func JSValueToInt64(ctx JSContextRef, value JSValueRef, exception unsafe.Pointer) int64
- func JSValueToNumber(ctx JSContextRef, value JSValueRef, exception unsafe.Pointer) float64
- func JSValueToUInt32(ctx JSContextRef, value JSValueRef, exception unsafe.Pointer) uint32
- func JSValueToUInt64(ctx JSContextRef, value JSValueRef, exception unsafe.Pointer) uint64
- func JSValueUnprotect(ctx JSContextRef, value JSValueRef)
- func KJSClassDefinitionEmpty() uintptr
- type Acl_type_t
- type Clockid
- type Context
- func (c *Context) Description() string
- func (c *Context) EvaluateScript(script string) *Value
- func (c *Context) EvaluateScriptWithSourceURL(script string, sourceURL string) *Value
- func (c *Context) Exception() *Value
- func (c *Context) GlobalObject() *Value
- func (c *Context) IsEqual(other obj.Object) bool
- func (c *Context) IsInspectable() bool
- func (c *Context) IsKind(className string) bool
- func (c *Context) JSGlobalContextRef() JSGlobalContextRef
- func (c *Context) Name() string
- func (c *Context) ObjectForKeyedSubscript(key obj.Object) *Value
- func (c *Context) SetObjectForKeyedSubscript(object obj.Object, key obj.Object)
- func (c *Context) String() string
- func (c *Context) VirtualMachine() *VirtualMachine
- func (c *Context) WithException(exception *Value) *Context
- func (c *Context) WithExceptionHandler(exceptionHandler func(obj.Object, obj.Object)) *Context
- func (c *Context) WithInspectable(inspectable bool) *Context
- func (c *Context) WithName(name string) *Context
- type DispatchAutoreleaseFrequency
- type DispatchBlockFlags
- type EntryID
- type Export
- type FilesecProperty
- type Flag
- type Idtype
- type IpcInfoObjectType
- type JSClassDefinition
- type JSClassRef
- type JSContextGroupRef
- type JSContextRef
- type JSGlobalContextRef
- func JSContextGetGlobalContext(ctx JSContextRef) JSGlobalContextRef
- func JSGlobalContextCreate(globalObjectClass JSClassRef) JSGlobalContextRef
- func JSGlobalContextCreateInGroup(group JSContextGroupRef, globalObjectClass JSClassRef) JSGlobalContextRef
- func JSGlobalContextRetain(ctx JSGlobalContextRef) JSGlobalContextRef
- type JSObjectRef
- func JSContextGetGlobalObject(ctx JSContextRef) JSObjectRef
- func JSObjectCallAsConstructor(ctx JSContextRef, object JSObjectRef, argumentCount int, ...) JSObjectRef
- func JSObjectGetTypedArrayBuffer(ctx JSContextRef, object JSObjectRef, exception unsafe.Pointer) JSObjectRef
- func JSObjectMake(ctx JSContextRef, jsClass JSClassRef, data unsafe.Pointer) JSObjectRef
- func JSObjectMakeArray(ctx JSContextRef, argumentCount int, arguments unsafe.Pointer, ...) JSObjectRef
- func JSObjectMakeArrayBufferWithBytesNoCopy(ctx JSContextRef, data unsafe.Pointer, byteLength int, ...) JSObjectRef
- func JSObjectMakeConstructor(ctx JSContextRef, jsClass JSClassRef, callAsConstructor unsafe.Pointer) JSObjectRef
- func JSObjectMakeDate(ctx JSContextRef, argumentCount int, arguments unsafe.Pointer, ...) JSObjectRef
- func JSObjectMakeDeferredPromise(ctx JSContextRef, resolve unsafe.Pointer, reject unsafe.Pointer, ...) JSObjectRef
- func JSObjectMakeError(ctx JSContextRef, argumentCount int, arguments unsafe.Pointer, ...) JSObjectRef
- func JSObjectMakeFunction(ctx JSContextRef, name JSStringRef, parameterCount int, ...) JSObjectRef
- func JSObjectMakeFunctionWithCallback(ctx JSContextRef, name JSStringRef, callAsFunction unsafe.Pointer) JSObjectRef
- func JSObjectMakeRegExp(ctx JSContextRef, argumentCount int, arguments unsafe.Pointer, ...) JSObjectRef
- func JSObjectMakeTypedArray(ctx JSContextRef, arrayType TypedArrayType, length int, ...) JSObjectRef
- func JSObjectMakeTypedArrayWithArrayBuffer(ctx JSContextRef, arrayType TypedArrayType, buffer JSObjectRef, ...) JSObjectRef
- func JSObjectMakeTypedArrayWithArrayBufferAndOffset(ctx JSContextRef, arrayType TypedArrayType, buffer JSObjectRef, byteOffset int, ...) JSObjectRef
- func JSObjectMakeTypedArrayWithBytesNoCopy(ctx JSContextRef, arrayType TypedArrayType, data unsafe.Pointer, ...) JSObjectRef
- func JSValueToObject(ctx JSContextRef, value JSValueRef, exception unsafe.Pointer) JSObjectRef
- type JSPropertyNameAccumulatorRef
- type JSPropertyNameArrayRef
- type JSStaticFunction
- type JSStaticValue
- type JSStringRef
- func JSGlobalContextCopyName(ctx JSGlobalContextRef) JSStringRef
- func JSPropertyNameArrayGetNameAtIndex(array JSPropertyNameArrayRef, index int) JSStringRef
- func JSStringCreateWithCFString(str corefoundation.CFStringRef) JSStringRef
- func JSStringCreateWithCharacters(chars unsafe.Pointer, numChars int) JSStringRef
- func JSStringCreateWithUTF8CString(str string) JSStringRef
- func JSStringRetain(str JSStringRef) JSStringRef
- func JSValueCreateJSONString(ctx JSContextRef, value JSValueRef, indent int, exception unsafe.Pointer) JSStringRef
- func JSValueToStringCopy(ctx JSContextRef, value JSValueRef, exception unsafe.Pointer) JSStringRef
- type JSValueRef
- func JSBigIntCreateWithDouble(ctx JSContextRef, value float64, exception unsafe.Pointer) JSValueRef
- func JSBigIntCreateWithInt64(ctx JSContextRef, integer int64, exception unsafe.Pointer) JSValueRef
- func JSBigIntCreateWithString(ctx JSContextRef, str JSStringRef, exception unsafe.Pointer) JSValueRef
- func JSBigIntCreateWithUInt64(ctx JSContextRef, integer uint64, exception unsafe.Pointer) JSValueRef
- func JSEvaluateScript(ctx JSContextRef, script JSStringRef, thisObject JSObjectRef, ...) JSValueRef
- func JSObjectCallAsFunction(ctx JSContextRef, object JSObjectRef, thisObject JSObjectRef, ...) JSValueRef
- func JSObjectGetProperty(ctx JSContextRef, object JSObjectRef, propertyName JSStringRef, ...) JSValueRef
- func JSObjectGetPropertyAtIndex(ctx JSContextRef, object JSObjectRef, propertyIndex int, ...) JSValueRef
- func JSObjectGetPropertyForKey(ctx JSContextRef, object JSObjectRef, propertyKey JSValueRef, ...) JSValueRef
- func JSObjectGetPrototype(ctx JSContextRef, object JSObjectRef) JSValueRef
- func JSValueMakeBoolean(ctx JSContextRef, boolean bool) JSValueRef
- func JSValueMakeFromJSONString(ctx JSContextRef, str JSStringRef) JSValueRef
- func JSValueMakeNull(ctx JSContextRef) JSValueRef
- func JSValueMakeNumber(ctx JSContextRef, number float64) JSValueRef
- func JSValueMakeString(ctx JSContextRef, str JSStringRef) JSValueRef
- func JSValueMakeSymbol(ctx JSContextRef, description JSStringRef) JSValueRef
- func JSValueMakeUndefined(ctx JSContextRef) JSValueRef
- type LaunchDataType
- type MDLabelDomain
- type MDQueryOptionFlags
- type MDQuerySortOptionFlags
- type MachVMRangeFlags
- type MachVMRangeFlavor
- type MachVMRangeTag
- type ManagedValue
- type MpoFlags
- type OSClockid
- type OpaqueJSClass
- type OpaqueJSContext
- type OpaqueJSContextGroup
- type OpaqueJSPropertyNameAccumulator
- type OpaqueJSPropertyNameArray
- type OpaqueJSString
- type OpaqueJSValue
- type Perm
- type PtrauthKey
- type QosClass
- type RelationCondition
- func JSValueCompare(ctx JSContextRef, left JSValueRef, right JSValueRef, exception unsafe.Pointer) RelationCondition
- func JSValueCompareDouble(ctx JSContextRef, left JSValueRef, right float64, exception unsafe.Pointer) RelationCondition
- func JSValueCompareInt64(ctx JSContextRef, left JSValueRef, right int64, exception unsafe.Pointer) RelationCondition
- func JSValueCompareUInt64(ctx JSContextRef, left JSValueRef, right uint64, exception unsafe.Pointer) RelationCondition
- type Tag
- type Type
- type TypedArrayType
- type Value
- func CurrentCallee() *Value
- func CurrentThis() *Value
- func NewValue() *Value
- func ValueFromID(id objc.ID) *Value
- func ValueWithBoolInContext(value bool, context_ *Context) *Value
- func ValueWithDoubleInContext(value float64, context_ *Context) *Value
- func ValueWithInt32InContext(value int32, context_ *Context) *Value
- func ValueWithJSValueRefInContext(value JSValueRef, context_ *Context) *Value
- func ValueWithNewArrayInContext(context_ *Context) *Value
- func ValueWithNewBigIntFromDoubleInContext(value float64, context_ *Context) *Value
- func ValueWithNewBigIntFromInt64InContext(int64 int64, context_ *Context) *Value
- func ValueWithNewBigIntFromStringInContext(str string, context_ *Context) *Value
- func ValueWithNewBigIntFromUInt64InContext(uint64 uint64, context_ *Context) *Value
- func ValueWithNewErrorFromMessageInContext(message string, context_ *Context) *Value
- func ValueWithNewObjectInContext(context_ *Context) *Value
- func ValueWithNewPromiseInContextFromExecutor(context_ *Context, callback func(obj.Object, obj.Object)) *Value
- func ValueWithNewPromiseRejectedWithReasonInContext(reason obj.Object, context_ *Context) *Value
- func ValueWithNewPromiseResolvedWithResultInContext(result obj.Object, context_ *Context) *Value
- func ValueWithNewRegularExpressionFromPatternFlagsInContext(pattern string, flags string, context_ *Context) *Value
- func ValueWithNewSymbolFromDescriptionInContext(description string, context_ *Context) *Value
- func ValueWithNullInContext(context_ *Context) *Value
- func ValueWithObjectInContext(value obj.Object, context_ *Context) *Value
- func ValueWithPointInContext(point corefoundation.CGPoint, context_ *Context) *Value
- func ValueWithRangeInContext(range_ foundation.NSRange, context_ *Context) *Value
- func ValueWithRectInContext(rect corefoundation.CGRect, context_ *Context) *Value
- func ValueWithSizeInContext(size corefoundation.CGSize, context_ *Context) *Value
- func ValueWithUInt32InContext(value uint32, context_ *Context) *Value
- func ValueWithUndefinedInContext(context_ *Context) *Value
- func (v_ *Value) CallWithArguments(arguments obj.Object) *Value
- func (v_ *Value) CompareDouble(other float64) RelationCondition
- func (v_ *Value) CompareInt64(other int64) RelationCondition
- func (v_ *Value) CompareJSValue(other *Value) RelationCondition
- func (v_ *Value) CompareUInt64(other uint64) RelationCondition
- func (v_ *Value) ConstructWithArguments(arguments obj.Object) *Value
- func (v_ *Value) Context() *Context
- func (v_ *Value) DefinePropertyDescriptor(property obj.Object, descriptor obj.Object)
- func (v_ *Value) DeleteProperty(property obj.Object) bool
- func (v_ *Value) Description() string
- func (v_ *Value) HasProperty(property obj.Object) bool
- func (v_ *Value) InvokeMethodWithArguments(method string, arguments obj.Object) *Value
- func (v_ *Value) IsArray() bool
- func (v_ *Value) IsBigInt() bool
- func (v_ *Value) IsBoolean() bool
- func (v_ *Value) IsDate() bool
- func (v_ *Value) IsEqual(other obj.Object) bool
- func (v_ *Value) IsEqualToObject(value obj.Object) bool
- func (v_ *Value) IsEqualWithTypeCoercionToObject(value obj.Object) bool
- func (v_ *Value) IsInstanceOf(value obj.Object) bool
- func (v_ *Value) IsKind(className string) bool
- func (v_ *Value) IsNull() bool
- func (v_ *Value) IsNumber() bool
- func (v_ *Value) IsObject() bool
- func (v_ *Value) IsString() bool
- func (v_ *Value) IsSymbol() bool
- func (v_ *Value) IsUndefined() bool
- func (v_ *Value) JSValueRef() JSValueRef
- func (v_ *Value) ObjectAtIndexedSubscript(index int) *Value
- func (v_ *Value) ObjectForKeyedSubscript(key obj.Object) *Value
- func (v_ *Value) SetObjectAtIndexedSubscript(object obj.Object, index int)
- func (v_ *Value) SetObjectForKeyedSubscript(object obj.Object, key obj.Object)
- func (v_ *Value) SetValueAtIndex(value obj.Object, index int)
- func (v_ *Value) SetValueForProperty(value obj.Object, property obj.Object)
- func (v_ *Value) String() string
- func (v_ *Value) ToArray() obj.Object
- func (v_ *Value) ToBool() bool
- func (v_ *Value) ToDate() time.Time
- func (v_ *Value) ToDictionary() obj.Object
- func (v_ *Value) ToDouble() float64
- func (v_ *Value) ToInt32() int32
- func (v_ *Value) ToInt64() int64
- func (v_ *Value) ToNumber() *foundation.Number
- func (v_ *Value) ToObject() obj.Object
- func (v_ *Value) ToPoint() corefoundation.CGPoint
- func (v_ *Value) ToRange() foundation.NSRange
- func (v_ *Value) ToRect() corefoundation.CGRect
- func (v_ *Value) ToSize() corefoundation.CGSize
- func (v_ *Value) ToString() string
- func (v_ *Value) ToUInt32() uint32
- func (v_ *Value) ToUInt64() uint64
- func (v_ *Value) ValueAtIndex(index int) *Value
- func (v_ *Value) ValueForProperty(property obj.Object) *Value
- type VirtualMachine
- func (vm *VirtualMachine) AddManagedReferenceWithOwner(object obj.Object, owner obj.Object)
- func (vm *VirtualMachine) Description() string
- func (vm *VirtualMachine) IsEqual(other obj.Object) bool
- func (vm *VirtualMachine) IsKind(className string) bool
- func (vm *VirtualMachine) RemoveManagedReferenceWithOwner(object obj.Object, owner obj.Object)
- func (vm *VirtualMachine) String() string
- type VirtualMemoryGuardExceptionCode
- type XpcListenerCreateFlags
- type XpcSessionCreateFlags
Constants ¶
const ( KJSClassAttributeNoAutomaticPrototype = 2 KJSClassAttributeNone = 0 KJSPropertyAttributeDontDelete = 8 KJSPropertyAttributeDontEnum = 4 KJSPropertyAttributeNone = 0 KJSPropertyAttributeReadOnly = 2 )
Variables ¶
This section is empty.
Functions ¶
func CurrentArguments ¶ added in v0.17.0
CurrentArguments returns the arguments to the current native callback from JavaScript code.
func JSCheckScriptSyntax ¶
func JSCheckScriptSyntax(ctx JSContextRef, script JSStringRef, sourceURL JSStringRef, startingLineNumber int, exception unsafe.Pointer) bool
JSCheckScriptSyntax calls the JavaScriptCore framework function JSCheckScriptSyntax.
func JSClassRelease ¶
func JSClassRelease(jsClass JSClassRef)
JSClassRelease calls the JavaScriptCore framework function JSClassRelease.
func JSContextGroupRelease ¶
func JSContextGroupRelease(group JSContextGroupRef)
JSContextGroupRelease calls the JavaScriptCore framework function JSContextGroupRelease.
func JSGarbageCollect ¶
func JSGarbageCollect(ctx JSContextRef)
JSGarbageCollect calls the JavaScriptCore framework function JSGarbageCollect.
func JSGlobalContextIsInspectable ¶
func JSGlobalContextIsInspectable(ctx JSGlobalContextRef) bool
JSGlobalContextIsInspectable calls the JavaScriptCore framework function JSGlobalContextIsInspectable.
func JSGlobalContextRelease ¶
func JSGlobalContextRelease(ctx JSGlobalContextRef)
JSGlobalContextRelease calls the JavaScriptCore framework function JSGlobalContextRelease.
func JSGlobalContextSetInspectable ¶
func JSGlobalContextSetInspectable(ctx JSGlobalContextRef, inspectable bool)
JSGlobalContextSetInspectable calls the JavaScriptCore framework function JSGlobalContextSetInspectable.
func JSGlobalContextSetName ¶
func JSGlobalContextSetName(ctx JSGlobalContextRef, name JSStringRef)
JSGlobalContextSetName calls the JavaScriptCore framework function JSGlobalContextSetName.
func JSObjectDeleteProperty ¶
func JSObjectDeleteProperty(ctx JSContextRef, object JSObjectRef, propertyName JSStringRef, exception unsafe.Pointer) bool
JSObjectDeleteProperty calls the JavaScriptCore framework function JSObjectDeleteProperty.
func JSObjectDeletePropertyForKey ¶
func JSObjectDeletePropertyForKey(ctx JSContextRef, object JSObjectRef, propertyKey JSValueRef, exception unsafe.Pointer) bool
JSObjectDeletePropertyForKey calls the JavaScriptCore framework function JSObjectDeletePropertyForKey.
func JSObjectGetArrayBufferByteLength ¶
func JSObjectGetArrayBufferByteLength(ctx JSContextRef, object JSObjectRef, exception unsafe.Pointer) int
JSObjectGetArrayBufferByteLength calls the JavaScriptCore framework function JSObjectGetArrayBufferByteLength.
func JSObjectGetArrayBufferBytesPtr ¶
func JSObjectGetArrayBufferBytesPtr(ctx JSContextRef, object JSObjectRef, exception unsafe.Pointer) unsafe.Pointer
JSObjectGetArrayBufferBytesPtr calls the JavaScriptCore framework function JSObjectGetArrayBufferBytesPtr.
func JSObjectGetPrivate ¶
func JSObjectGetPrivate(object JSObjectRef) unsafe.Pointer
JSObjectGetPrivate calls the JavaScriptCore framework function JSObjectGetPrivate.
func JSObjectGetTypedArrayByteLength ¶
func JSObjectGetTypedArrayByteLength(ctx JSContextRef, object JSObjectRef, exception unsafe.Pointer) int
JSObjectGetTypedArrayByteLength calls the JavaScriptCore framework function JSObjectGetTypedArrayByteLength.
func JSObjectGetTypedArrayByteOffset ¶
func JSObjectGetTypedArrayByteOffset(ctx JSContextRef, object JSObjectRef, exception unsafe.Pointer) int
JSObjectGetTypedArrayByteOffset calls the JavaScriptCore framework function JSObjectGetTypedArrayByteOffset.
func JSObjectGetTypedArrayBytesPtr ¶
func JSObjectGetTypedArrayBytesPtr(ctx JSContextRef, object JSObjectRef, exception unsafe.Pointer) unsafe.Pointer
JSObjectGetTypedArrayBytesPtr calls the JavaScriptCore framework function JSObjectGetTypedArrayBytesPtr.
func JSObjectGetTypedArrayLength ¶
func JSObjectGetTypedArrayLength(ctx JSContextRef, object JSObjectRef, exception unsafe.Pointer) int
JSObjectGetTypedArrayLength calls the JavaScriptCore framework function JSObjectGetTypedArrayLength.
func JSObjectHasProperty ¶
func JSObjectHasProperty(ctx JSContextRef, object JSObjectRef, propertyName JSStringRef) bool
JSObjectHasProperty calls the JavaScriptCore framework function JSObjectHasProperty.
func JSObjectHasPropertyForKey ¶
func JSObjectHasPropertyForKey(ctx JSContextRef, object JSObjectRef, propertyKey JSValueRef, exception unsafe.Pointer) bool
JSObjectHasPropertyForKey calls the JavaScriptCore framework function JSObjectHasPropertyForKey.
func JSObjectIsConstructor ¶
func JSObjectIsConstructor(ctx JSContextRef, object JSObjectRef) bool
JSObjectIsConstructor calls the JavaScriptCore framework function JSObjectIsConstructor.
func JSObjectIsFunction ¶
func JSObjectIsFunction(ctx JSContextRef, object JSObjectRef) bool
JSObjectIsFunction calls the JavaScriptCore framework function JSObjectIsFunction.
func JSObjectSetPrivate ¶
func JSObjectSetPrivate(object JSObjectRef, data unsafe.Pointer) bool
JSObjectSetPrivate calls the JavaScriptCore framework function JSObjectSetPrivate.
func JSObjectSetProperty ¶
func JSObjectSetProperty(ctx JSContextRef, object JSObjectRef, propertyName JSStringRef, value JSValueRef, attributes int, exception unsafe.Pointer)
JSObjectSetProperty calls the JavaScriptCore framework function JSObjectSetProperty.
func JSObjectSetPropertyAtIndex ¶
func JSObjectSetPropertyAtIndex(ctx JSContextRef, object JSObjectRef, propertyIndex int, value JSValueRef, exception unsafe.Pointer)
JSObjectSetPropertyAtIndex calls the JavaScriptCore framework function JSObjectSetPropertyAtIndex.
func JSObjectSetPropertyForKey ¶
func JSObjectSetPropertyForKey(ctx JSContextRef, object JSObjectRef, propertyKey JSValueRef, value JSValueRef, attributes int, exception unsafe.Pointer)
JSObjectSetPropertyForKey calls the JavaScriptCore framework function JSObjectSetPropertyForKey.
func JSObjectSetPrototype ¶
func JSObjectSetPrototype(ctx JSContextRef, object JSObjectRef, value JSValueRef)
JSObjectSetPrototype calls the JavaScriptCore framework function JSObjectSetPrototype.
func JSPropertyDescriptorConfigurableKey ¶
JSPropertyDescriptorConfigurableKey returns the string constant JSPropertyDescriptorConfigurableKey, for use as a dictionary key or argument.
func JSPropertyDescriptorEnumerableKey ¶
JSPropertyDescriptorEnumerableKey returns the string constant JSPropertyDescriptorEnumerableKey, for use as a dictionary key or argument.
func JSPropertyDescriptorGetKey ¶
JSPropertyDescriptorGetKey returns the string constant JSPropertyDescriptorGetKey, for use as a dictionary key or argument.
func JSPropertyDescriptorSetKey ¶
JSPropertyDescriptorSetKey returns the string constant JSPropertyDescriptorSetKey, for use as a dictionary key or argument.
func JSPropertyDescriptorValueKey ¶
JSPropertyDescriptorValueKey returns the string constant JSPropertyDescriptorValueKey, for use as a dictionary key or argument.
func JSPropertyDescriptorWritableKey ¶
JSPropertyDescriptorWritableKey returns the string constant JSPropertyDescriptorWritableKey, for use as a dictionary key or argument.
func JSPropertyNameAccumulatorAddName ¶
func JSPropertyNameAccumulatorAddName(accumulator JSPropertyNameAccumulatorRef, propertyName JSStringRef)
JSPropertyNameAccumulatorAddName calls the JavaScriptCore framework function JSPropertyNameAccumulatorAddName.
func JSPropertyNameArrayGetCount ¶
func JSPropertyNameArrayGetCount(array JSPropertyNameArrayRef) int
JSPropertyNameArrayGetCount calls the JavaScriptCore framework function JSPropertyNameArrayGetCount.
func JSPropertyNameArrayRelease ¶
func JSPropertyNameArrayRelease(array JSPropertyNameArrayRef)
JSPropertyNameArrayRelease calls the JavaScriptCore framework function JSPropertyNameArrayRelease.
func JSStringCopyCFString ¶
func JSStringCopyCFString(alloc corefoundation.CFAllocatorRef, str JSStringRef) corefoundation.CFStringRef
JSStringCopyCFString calls the JavaScriptCore framework function JSStringCopyCFString.
func JSStringGetCharactersPtr ¶
func JSStringGetCharactersPtr(str JSStringRef) unsafe.Pointer
JSStringGetCharactersPtr calls the JavaScriptCore framework function JSStringGetCharactersPtr.
func JSStringGetLength ¶
func JSStringGetLength(str JSStringRef) int
JSStringGetLength calls the JavaScriptCore framework function JSStringGetLength.
func JSStringGetMaximumUTF8CStringSize ¶
func JSStringGetMaximumUTF8CStringSize(str JSStringRef) int
JSStringGetMaximumUTF8CStringSize calls the JavaScriptCore framework function JSStringGetMaximumUTF8CStringSize.
func JSStringGetUTF8CString ¶
func JSStringGetUTF8CString(str JSStringRef, buffer string, bufferSize int) int
JSStringGetUTF8CString calls the JavaScriptCore framework function JSStringGetUTF8CString.
func JSStringIsEqual ¶
func JSStringIsEqual(a JSStringRef, b JSStringRef) bool
JSStringIsEqual calls the JavaScriptCore framework function JSStringIsEqual.
func JSStringIsEqualToUTF8CString ¶
func JSStringIsEqualToUTF8CString(a JSStringRef, b string) bool
JSStringIsEqualToUTF8CString calls the JavaScriptCore framework function JSStringIsEqualToUTF8CString.
func JSStringRelease ¶
func JSStringRelease(str JSStringRef)
JSStringRelease calls the JavaScriptCore framework function JSStringRelease.
func JSValueIsArray ¶
func JSValueIsArray(ctx JSContextRef, value JSValueRef) bool
JSValueIsArray calls the JavaScriptCore framework function JSValueIsArray.
func JSValueIsBigInt ¶
func JSValueIsBigInt(ctx JSContextRef, value JSValueRef) bool
JSValueIsBigInt calls the JavaScriptCore framework function JSValueIsBigInt.
func JSValueIsBoolean ¶
func JSValueIsBoolean(ctx JSContextRef, value JSValueRef) bool
JSValueIsBoolean calls the JavaScriptCore framework function JSValueIsBoolean.
func JSValueIsDate ¶
func JSValueIsDate(ctx JSContextRef, value JSValueRef) bool
JSValueIsDate calls the JavaScriptCore framework function JSValueIsDate.
func JSValueIsEqual ¶
func JSValueIsEqual(ctx JSContextRef, a JSValueRef, b JSValueRef, exception unsafe.Pointer) bool
JSValueIsEqual calls the JavaScriptCore framework function JSValueIsEqual.
func JSValueIsInstanceOfConstructor ¶
func JSValueIsInstanceOfConstructor(ctx JSContextRef, value JSValueRef, constructor JSObjectRef, exception unsafe.Pointer) bool
JSValueIsInstanceOfConstructor calls the JavaScriptCore framework function JSValueIsInstanceOfConstructor.
func JSValueIsNull ¶
func JSValueIsNull(ctx JSContextRef, value JSValueRef) bool
JSValueIsNull calls the JavaScriptCore framework function JSValueIsNull.
func JSValueIsNumber ¶
func JSValueIsNumber(ctx JSContextRef, value JSValueRef) bool
JSValueIsNumber calls the JavaScriptCore framework function JSValueIsNumber.
func JSValueIsObject ¶
func JSValueIsObject(ctx JSContextRef, value JSValueRef) bool
JSValueIsObject calls the JavaScriptCore framework function JSValueIsObject.
func JSValueIsObjectOfClass ¶
func JSValueIsObjectOfClass(ctx JSContextRef, value JSValueRef, jsClass JSClassRef) bool
JSValueIsObjectOfClass calls the JavaScriptCore framework function JSValueIsObjectOfClass.
func JSValueIsStrictEqual ¶
func JSValueIsStrictEqual(ctx JSContextRef, a JSValueRef, b JSValueRef) bool
JSValueIsStrictEqual calls the JavaScriptCore framework function JSValueIsStrictEqual.
func JSValueIsString ¶
func JSValueIsString(ctx JSContextRef, value JSValueRef) bool
JSValueIsString calls the JavaScriptCore framework function JSValueIsString.
func JSValueIsSymbol ¶
func JSValueIsSymbol(ctx JSContextRef, value JSValueRef) bool
JSValueIsSymbol calls the JavaScriptCore framework function JSValueIsSymbol.
func JSValueIsUndefined ¶
func JSValueIsUndefined(ctx JSContextRef, value JSValueRef) bool
JSValueIsUndefined calls the JavaScriptCore framework function JSValueIsUndefined.
func JSValueProtect ¶
func JSValueProtect(ctx JSContextRef, value JSValueRef)
JSValueProtect calls the JavaScriptCore framework function JSValueProtect.
func JSValueToBoolean ¶
func JSValueToBoolean(ctx JSContextRef, value JSValueRef) bool
JSValueToBoolean calls the JavaScriptCore framework function JSValueToBoolean.
func JSValueToInt32 ¶
func JSValueToInt32(ctx JSContextRef, value JSValueRef, exception unsafe.Pointer) int32
JSValueToInt32 calls the JavaScriptCore framework function JSValueToInt32.
func JSValueToInt64 ¶
func JSValueToInt64(ctx JSContextRef, value JSValueRef, exception unsafe.Pointer) int64
JSValueToInt64 calls the JavaScriptCore framework function JSValueToInt64.
func JSValueToNumber ¶
func JSValueToNumber(ctx JSContextRef, value JSValueRef, exception unsafe.Pointer) float64
JSValueToNumber calls the JavaScriptCore framework function JSValueToNumber.
func JSValueToUInt32 ¶
func JSValueToUInt32(ctx JSContextRef, value JSValueRef, exception unsafe.Pointer) uint32
JSValueToUInt32 calls the JavaScriptCore framework function JSValueToUInt32.
func JSValueToUInt64 ¶
func JSValueToUInt64(ctx JSContextRef, value JSValueRef, exception unsafe.Pointer) uint64
JSValueToUInt64 calls the JavaScriptCore framework function JSValueToUInt64.
func JSValueUnprotect ¶
func JSValueUnprotect(ctx JSContextRef, value JSValueRef)
JSValueUnprotect calls the JavaScriptCore framework function JSValueUnprotect.
func KJSClassDefinitionEmpty ¶
func KJSClassDefinitionEmpty() uintptr
KJSClassDefinitionEmpty returns the address of the symbol kJSClassDefinitionEmpty.
Types ¶
type Acl_type_t ¶
type Acl_type_t int32
const ( Acl_type_tExtended Acl_type_t = 256 Acl_type_tAccess Acl_type_t = 0 Acl_type_tDefault Acl_type_t = 1 Acl_type_tAfs Acl_type_t = 2 Acl_type_tCoda Acl_type_t = 3 Acl_type_tNtfs Acl_type_t = 4 Acl_type_tNwfs Acl_type_t = 5 )
func (Acl_type_t) String ¶
func (e Acl_type_t) String() string
String returns the Acl_type_t constant's name, or its numeric form when the value is not a known constant.
type Context ¶ added in v0.17.0
Context is an idiomatic wrapper over the Objective-C class JSContext.
A JavaScript execution environment.
func ContextFromID ¶ added in v0.17.0
ContextFromID adopts an existing Objective-C object as a Context (nil for 0), retaining it and registering a release finalizer.
func ContextWithJSGlobalContextRef ¶ added in v0.17.0
func ContextWithJSGlobalContextRef(jsGlobalContextRef JSGlobalContextRef) *Context
ContextWithJSGlobalContextRef create a JSContext, wrapping its C API counterpart.
func CurrentContext ¶ added in v0.17.0
func CurrentContext() *Context
CurrentContext returns the context currently executing JavaScript code.
func NewContextWithVirtualMachine ¶ added in v0.17.0
func NewContextWithVirtualMachine(virtualMachine *VirtualMachine) *Context
NewContextWithVirtualMachine creates a new JavaScript context associated with a specific virtual machine.
func (*Context) Description ¶ added in v0.17.0
Description returns the object's -description text.
func (*Context) EvaluateScript ¶ added in v0.17.0
EvaluateScript executes the specified JavaScript code.
func (*Context) EvaluateScriptWithSourceURL ¶ added in v0.17.0
EvaluateScriptWithSourceURL executes the specified JavaScript code, treating the specified URL as its source location.
func (*Context) Exception ¶ added in v0.17.0
Exception returns 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).
func (*Context) GlobalObject ¶ added in v0.17.0
GlobalObject get the global object of the context. 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.
func (*Context) IsEqual ¶ added in v0.17.0
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*Context) IsInspectable ¶ added in v0.17.0
IsInspectable reports whether controls whether this
func (*Context) IsKind ¶ added in v0.17.0
IsKind reports whether the object is an instance of the named class or a subclass.
func (*Context) JSGlobalContextRef ¶ added in v0.17.0
func (c *Context) JSGlobalContextRef() JSGlobalContextRef
JSGlobalContextRef returns the js global context ref.
func (*Context) Name ¶ added in v0.17.0
Name returns name of the JSContext. Exposed when inspecting the context.
func (*Context) ObjectForKeyedSubscript ¶ added in v0.17.0
ObjectForKeyedSubscript returns the value of the specified JavaScript property in the context’s global object, allowing subscript getter syntax.
func (*Context) SetObjectForKeyedSubscript ¶ added in v0.17.0
SetObjectForKeyedSubscript sets the specified JavaScript property of the context’s global object, allowing subscript setter syntax.
func (*Context) String ¶ added in v0.17.0
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*Context) VirtualMachine ¶ added in v0.17.0
func (c *Context) VirtualMachine() *VirtualMachine
VirtualMachine returns all instances of JSContext are associated with a JSVirtualMachine.
func (*Context) WithException ¶ added in v0.17.0
WithException sets a JavaScript exception to be thrown in evaluation of the script.
func (*Context) WithExceptionHandler ¶ added in v0.17.0
WithExceptionHandler sets a block to be invoked should evaluating a script result in a JavaScript exception being thrown.
func (*Context) WithInspectable ¶ added in v0.17.0
WithInspectable sets a Boolean value that indicates whether you can inspect the JavaScript context with Safari Web Inspector.
type DispatchAutoreleaseFrequency ¶ added in v0.17.0
type DispatchAutoreleaseFrequency uint64
const ( DispatchAutoreleaseFrequencyInherit DispatchAutoreleaseFrequency = 0 DispatchAutoreleaseFrequencyWorkItem DispatchAutoreleaseFrequency = 1 DispatchAutoreleaseFrequencyNever DispatchAutoreleaseFrequency = 2 )
func (DispatchAutoreleaseFrequency) String ¶ added in v0.17.0
func (e DispatchAutoreleaseFrequency) String() string
String returns the DispatchAutoreleaseFrequency constant's name, or its numeric form when the value is not a known constant.
type DispatchBlockFlags ¶ added in v0.17.0
type DispatchBlockFlags uint64
Bitmask — values may be combined with |.
const ( DispatchBlockFlagsBarrier DispatchBlockFlags = 1 DispatchBlockFlagsDetached DispatchBlockFlags = 2 DispatchBlockFlagsAssignCurrent DispatchBlockFlags = 4 DispatchBlockFlagsNoQosClass DispatchBlockFlags = 8 DispatchBlockFlagsInheritQosClass DispatchBlockFlags = 16 DispatchBlockFlagsEnforceQosClass DispatchBlockFlags = 32 )
func (DispatchBlockFlags) String ¶ added in v0.17.0
func (e DispatchBlockFlags) String() string
String returns the DispatchBlockFlags constant's name, or its numeric form when the value is not a known constant.
type Export ¶ added in v0.17.0
type Export interface {
}
Export is the Go form of the Objective-C protocol JSExport.
type FilesecProperty ¶ added in v0.17.0
type FilesecProperty int32
const ( FilesecPropertyOwner FilesecProperty = 1 FilesecPropertyGroup FilesecProperty = 2 FilesecPropertyUUID FilesecProperty = 3 FilesecPropertyMode FilesecProperty = 4 FilesecPropertyACL FilesecProperty = 5 FilesecPropertyGrpuuid FilesecProperty = 6 FilesecPropertyACLRaw FilesecProperty = 100 FilesecPropertyACLAllocsize FilesecProperty = 101 )
func (FilesecProperty) String ¶ added in v0.17.0
func (e FilesecProperty) String() string
String returns the FilesecProperty constant's name, or its numeric form when the value is not a known constant.
type IpcInfoObjectType ¶ added in v0.17.0
type IpcInfoObjectType uint32
const ( IpcInfoObjectTypeNone IpcInfoObjectType = 0 IpcInfoObjectTypeThreadControl IpcInfoObjectType = 1 IpcInfoObjectTypeTaskControl IpcInfoObjectType = 2 IpcInfoObjectTypeHost IpcInfoObjectType = 3 IpcInfoObjectTypeHostPriv IpcInfoObjectType = 4 IpcInfoObjectTypeProcessor IpcInfoObjectType = 5 IpcInfoObjectTypeProcessorSet IpcInfoObjectType = 6 IpcInfoObjectTypeProcessorSetName IpcInfoObjectType = 7 IpcInfoObjectTypeTimer IpcInfoObjectType = 8 IpcInfoObjectTypePortSubstOnce IpcInfoObjectType = 9 IpcInfoObjectTypeMig IpcInfoObjectType = 10 IpcInfoObjectTypeMemoryObject IpcInfoObjectType = 11 IpcInfoObjectTypeXmmPager IpcInfoObjectType = 12 IpcInfoObjectTypeXmmKernel IpcInfoObjectType = 13 IpcInfoObjectTypeXmmReply IpcInfoObjectType = 14 IpcInfoObjectTypeUndReply IpcInfoObjectType = 15 IpcInfoObjectTypeHostNotify IpcInfoObjectType = 16 IpcInfoObjectTypeHostSecurity IpcInfoObjectType = 17 IpcInfoObjectTypeLedger IpcInfoObjectType = 18 IpcInfoObjectTypeMainDevice IpcInfoObjectType = 19 IpcInfoObjectTypeTaskName IpcInfoObjectType = 20 IpcInfoObjectTypeSubsystem IpcInfoObjectType = 21 IpcInfoObjectTypeIODoneQueue IpcInfoObjectType = 22 IpcInfoObjectTypeSemaphore IpcInfoObjectType = 23 IpcInfoObjectTypeLockSet IpcInfoObjectType = 24 IpcInfoObjectTypeClock IpcInfoObjectType = 25 IpcInfoObjectTypeClockCtrl IpcInfoObjectType = 26 IpcInfoObjectTypeIokitIdent IpcInfoObjectType = 27 IpcInfoObjectTypeNamedEntry IpcInfoObjectType = 28 IpcInfoObjectTypeIokitConnect IpcInfoObjectType = 29 IpcInfoObjectTypeIokitObject IpcInfoObjectType = 30 IpcInfoObjectTypeUpl IpcInfoObjectType = 31 IpcInfoObjectTypeMemObjControl IpcInfoObjectType = 32 IpcInfoObjectTypeAuSessionport IpcInfoObjectType = 33 IpcInfoObjectTypeFileport IpcInfoObjectType = 34 IpcInfoObjectTypeLabelh IpcInfoObjectType = 35 IpcInfoObjectTypeTaskResume IpcInfoObjectType = 36 IpcInfoObjectTypeVoucher IpcInfoObjectType = 37 IpcInfoObjectTypeVoucherAttrControl IpcInfoObjectType = 38 IpcInfoObjectTypeWorkInterval IpcInfoObjectType = 39 IpcInfoObjectTypeUxHandler IpcInfoObjectType = 40 IpcInfoObjectTypeUextObject IpcInfoObjectType = 41 IpcInfoObjectTypeArcadeReg IpcInfoObjectType = 42 IpcInfoObjectTypeEventlink IpcInfoObjectType = 43 IpcInfoObjectTypeTaskInspect IpcInfoObjectType = 44 IpcInfoObjectTypeTaskRead IpcInfoObjectType = 45 IpcInfoObjectTypeThreadInspect IpcInfoObjectType = 46 IpcInfoObjectTypeThreadRead IpcInfoObjectType = 47 IpcInfoObjectTypeSuidCred IpcInfoObjectType = 48 IpcInfoObjectTypeHypervisor IpcInfoObjectType = 49 IpcInfoObjectTypeTaskIDToken IpcInfoObjectType = 50 IpcInfoObjectTypeTaskFatal IpcInfoObjectType = 51 IpcInfoObjectTypeKcdata IpcInfoObjectType = 52 IpcInfoObjectTypeExclavesResource IpcInfoObjectType = 53 IpcInfoObjectTypeThreadResume IpcInfoObjectType = 54 IpcInfoObjectTypeUnknown IpcInfoObjectType = 4294967295 )
func (IpcInfoObjectType) String ¶ added in v0.17.0
func (e IpcInfoObjectType) String() string
String returns the IpcInfoObjectType constant's name, or its numeric form when the value is not a known constant.
type JSClassDefinition ¶
type JSClassDefinition struct {
Version int32
Attributes uint32
ClassName unsafe.Pointer
ParentClass unsafe.Pointer
StaticValues unsafe.Pointer
StaticFunctions unsafe.Pointer
Initialize unsafe.Pointer
Finalize unsafe.Pointer
HasProperty unsafe.Pointer
GetProperty unsafe.Pointer
SetProperty unsafe.Pointer
DeleteProperty unsafe.Pointer
GetPropertyNames unsafe.Pointer
CallAsFunction unsafe.Pointer
CallAsConstructor unsafe.Pointer
HasInstance unsafe.Pointer
ConvertToType unsafe.Pointer
}
A structure that contains properties and callbacks that define a type of object.
type JSClassRef ¶ added in v0.18.0
JSClassRef is a handle for the opaque JSClassRef type.
func JSClassCreate ¶
func JSClassCreate(definition unsafe.Pointer) JSClassRef
JSClassCreate calls the JavaScriptCore framework function JSClassCreate.
func JSClassRetain ¶
func JSClassRetain(jsClass JSClassRef) JSClassRef
JSClassRetain calls the JavaScriptCore framework function JSClassRetain.
func (JSClassRef) IsNil ¶ added in v0.18.0
func (h JSClassRef) IsNil() bool
IsNil reports whether JSClassRef is a NULL handle (it wraps no object). Call it before using a returned handle; a nil handle's methods panic.
type JSContextGroupRef ¶ added in v0.18.0
JSContextGroupRef is a handle for the opaque JSContextGroupRef type.
func JSContextGetGroup ¶
func JSContextGetGroup(ctx JSContextRef) JSContextGroupRef
JSContextGetGroup calls the JavaScriptCore framework function JSContextGetGroup.
func JSContextGroupCreate ¶
func JSContextGroupCreate() JSContextGroupRef
JSContextGroupCreate calls the JavaScriptCore framework function JSContextGroupCreate.
func JSContextGroupRetain ¶
func JSContextGroupRetain(group JSContextGroupRef) JSContextGroupRef
JSContextGroupRetain calls the JavaScriptCore framework function JSContextGroupRetain.
func (JSContextGroupRef) IsNil ¶ added in v0.18.0
func (h JSContextGroupRef) IsNil() bool
IsNil reports whether JSContextGroupRef is a NULL handle (it wraps no object). Call it before using a returned handle; a nil handle's methods panic.
type JSContextRef ¶ added in v0.18.0
JSContextRef is a handle for the opaque JSContextRef type.
func (JSContextRef) IsNil ¶ added in v0.18.0
func (h JSContextRef) IsNil() bool
IsNil reports whether JSContextRef is a NULL handle (it wraps no object). Call it before using a returned handle; a nil handle's methods panic.
type JSGlobalContextRef ¶ added in v0.18.0
JSGlobalContextRef is a handle for the opaque JSGlobalContextRef type.
func JSContextGetGlobalContext ¶
func JSContextGetGlobalContext(ctx JSContextRef) JSGlobalContextRef
JSContextGetGlobalContext calls the JavaScriptCore framework function JSContextGetGlobalContext.
func JSGlobalContextCreate ¶
func JSGlobalContextCreate(globalObjectClass JSClassRef) JSGlobalContextRef
JSGlobalContextCreate calls the JavaScriptCore framework function JSGlobalContextCreate.
func JSGlobalContextCreateInGroup ¶
func JSGlobalContextCreateInGroup(group JSContextGroupRef, globalObjectClass JSClassRef) JSGlobalContextRef
JSGlobalContextCreateInGroup calls the JavaScriptCore framework function JSGlobalContextCreateInGroup.
func JSGlobalContextRetain ¶
func JSGlobalContextRetain(ctx JSGlobalContextRef) JSGlobalContextRef
JSGlobalContextRetain calls the JavaScriptCore framework function JSGlobalContextRetain.
func (JSGlobalContextRef) IsNil ¶ added in v0.18.0
func (h JSGlobalContextRef) IsNil() bool
IsNil reports whether JSGlobalContextRef is a NULL handle (it wraps no object). Call it before using a returned handle; a nil handle's methods panic.
type JSObjectRef ¶ added in v0.18.0
JSObjectRef is a handle for the opaque JSObjectRef type.
func JSContextGetGlobalObject ¶
func JSContextGetGlobalObject(ctx JSContextRef) JSObjectRef
JSContextGetGlobalObject calls the JavaScriptCore framework function JSContextGetGlobalObject.
func JSObjectCallAsConstructor ¶
func JSObjectCallAsConstructor(ctx JSContextRef, object JSObjectRef, argumentCount int, arguments unsafe.Pointer, exception unsafe.Pointer) JSObjectRef
JSObjectCallAsConstructor calls the JavaScriptCore framework function JSObjectCallAsConstructor.
func JSObjectGetTypedArrayBuffer ¶
func JSObjectGetTypedArrayBuffer(ctx JSContextRef, object JSObjectRef, exception unsafe.Pointer) JSObjectRef
JSObjectGetTypedArrayBuffer calls the JavaScriptCore framework function JSObjectGetTypedArrayBuffer.
func JSObjectMake ¶
func JSObjectMake(ctx JSContextRef, jsClass JSClassRef, data unsafe.Pointer) JSObjectRef
JSObjectMake calls the JavaScriptCore framework function JSObjectMake.
func JSObjectMakeArray ¶
func JSObjectMakeArray(ctx JSContextRef, argumentCount int, arguments unsafe.Pointer, exception unsafe.Pointer) JSObjectRef
JSObjectMakeArray calls the JavaScriptCore framework function JSObjectMakeArray.
func JSObjectMakeArrayBufferWithBytesNoCopy ¶
func JSObjectMakeArrayBufferWithBytesNoCopy(ctx JSContextRef, data unsafe.Pointer, byteLength int, bytesDeallocator unsafe.Pointer, deallocatorContext unsafe.Pointer, exception unsafe.Pointer) JSObjectRef
JSObjectMakeArrayBufferWithBytesNoCopy calls the JavaScriptCore framework function JSObjectMakeArrayBufferWithBytesNoCopy.
func JSObjectMakeConstructor ¶
func JSObjectMakeConstructor(ctx JSContextRef, jsClass JSClassRef, callAsConstructor unsafe.Pointer) JSObjectRef
JSObjectMakeConstructor calls the JavaScriptCore framework function JSObjectMakeConstructor.
func JSObjectMakeDate ¶
func JSObjectMakeDate(ctx JSContextRef, argumentCount int, arguments unsafe.Pointer, exception unsafe.Pointer) JSObjectRef
JSObjectMakeDate calls the JavaScriptCore framework function JSObjectMakeDate.
func JSObjectMakeDeferredPromise ¶
func JSObjectMakeDeferredPromise(ctx JSContextRef, resolve unsafe.Pointer, reject unsafe.Pointer, exception unsafe.Pointer) JSObjectRef
JSObjectMakeDeferredPromise calls the JavaScriptCore framework function JSObjectMakeDeferredPromise.
func JSObjectMakeError ¶
func JSObjectMakeError(ctx JSContextRef, argumentCount int, arguments unsafe.Pointer, exception unsafe.Pointer) JSObjectRef
JSObjectMakeError calls the JavaScriptCore framework function JSObjectMakeError.
func JSObjectMakeFunction ¶
func JSObjectMakeFunction(ctx JSContextRef, name JSStringRef, parameterCount int, parameterNames unsafe.Pointer, body JSStringRef, sourceURL JSStringRef, startingLineNumber int, exception unsafe.Pointer) JSObjectRef
JSObjectMakeFunction calls the JavaScriptCore framework function JSObjectMakeFunction.
func JSObjectMakeFunctionWithCallback ¶
func JSObjectMakeFunctionWithCallback(ctx JSContextRef, name JSStringRef, callAsFunction unsafe.Pointer) JSObjectRef
JSObjectMakeFunctionWithCallback calls the JavaScriptCore framework function JSObjectMakeFunctionWithCallback.
func JSObjectMakeRegExp ¶
func JSObjectMakeRegExp(ctx JSContextRef, argumentCount int, arguments unsafe.Pointer, exception unsafe.Pointer) JSObjectRef
JSObjectMakeRegExp calls the JavaScriptCore framework function JSObjectMakeRegExp.
func JSObjectMakeTypedArray ¶
func JSObjectMakeTypedArray(ctx JSContextRef, arrayType TypedArrayType, length int, exception unsafe.Pointer) JSObjectRef
JSObjectMakeTypedArray calls the JavaScriptCore framework function JSObjectMakeTypedArray.
func JSObjectMakeTypedArrayWithArrayBuffer ¶
func JSObjectMakeTypedArrayWithArrayBuffer(ctx JSContextRef, arrayType TypedArrayType, buffer JSObjectRef, exception unsafe.Pointer) JSObjectRef
JSObjectMakeTypedArrayWithArrayBuffer calls the JavaScriptCore framework function JSObjectMakeTypedArrayWithArrayBuffer.
func JSObjectMakeTypedArrayWithArrayBufferAndOffset ¶
func JSObjectMakeTypedArrayWithArrayBufferAndOffset(ctx JSContextRef, arrayType TypedArrayType, buffer JSObjectRef, byteOffset int, length int, exception unsafe.Pointer) JSObjectRef
JSObjectMakeTypedArrayWithArrayBufferAndOffset calls the JavaScriptCore framework function JSObjectMakeTypedArrayWithArrayBufferAndOffset.
func JSObjectMakeTypedArrayWithBytesNoCopy ¶
func JSObjectMakeTypedArrayWithBytesNoCopy(ctx JSContextRef, arrayType TypedArrayType, data unsafe.Pointer, byteLength int, bytesDeallocator unsafe.Pointer, deallocatorContext unsafe.Pointer, exception unsafe.Pointer) JSObjectRef
JSObjectMakeTypedArrayWithBytesNoCopy calls the JavaScriptCore framework function JSObjectMakeTypedArrayWithBytesNoCopy.
func JSValueToObject ¶
func JSValueToObject(ctx JSContextRef, value JSValueRef, exception unsafe.Pointer) JSObjectRef
JSValueToObject calls the JavaScriptCore framework function JSValueToObject.
func (JSObjectRef) IsNil ¶ added in v0.18.0
func (h JSObjectRef) IsNil() bool
IsNil reports whether JSObjectRef is a NULL handle (it wraps no object). Call it before using a returned handle; a nil handle's methods panic.
type JSPropertyNameAccumulatorRef ¶ added in v0.18.0
JSPropertyNameAccumulatorRef is a handle for the opaque JSPropertyNameAccumulatorRef type.
func (JSPropertyNameAccumulatorRef) IsNil ¶ added in v0.18.0
func (h JSPropertyNameAccumulatorRef) IsNil() bool
IsNil reports whether JSPropertyNameAccumulatorRef is a NULL handle (it wraps no object). Call it before using a returned handle; a nil handle's methods panic.
type JSPropertyNameArrayRef ¶ added in v0.18.0
JSPropertyNameArrayRef is a handle for the opaque JSPropertyNameArrayRef type.
func JSObjectCopyPropertyNames ¶
func JSObjectCopyPropertyNames(ctx JSContextRef, object JSObjectRef) JSPropertyNameArrayRef
JSObjectCopyPropertyNames calls the JavaScriptCore framework function JSObjectCopyPropertyNames.
func JSPropertyNameArrayRetain ¶
func JSPropertyNameArrayRetain(array JSPropertyNameArrayRef) JSPropertyNameArrayRef
JSPropertyNameArrayRetain calls the JavaScriptCore framework function JSPropertyNameArrayRetain.
func (JSPropertyNameArrayRef) IsNil ¶ added in v0.18.0
func (h JSPropertyNameArrayRef) IsNil() bool
IsNil reports whether JSPropertyNameArrayRef is a NULL handle (it wraps no object). Call it before using a returned handle; a nil handle's methods panic.
type JSStaticFunction ¶
type JSStaticFunction struct {
Name unsafe.Pointer
CallAsFunction unsafe.Pointer
Attributes uint32
}
A statically declared function property.
type JSStaticValue ¶
type JSStaticValue struct {
Name unsafe.Pointer
GetProperty unsafe.Pointer
SetProperty unsafe.Pointer
Attributes uint32
}
A statically declared value property.
type JSStringRef ¶ added in v0.18.0
JSStringRef is a handle for the opaque JSStringRef type.
func JSGlobalContextCopyName ¶
func JSGlobalContextCopyName(ctx JSGlobalContextRef) JSStringRef
JSGlobalContextCopyName calls the JavaScriptCore framework function JSGlobalContextCopyName.
func JSPropertyNameArrayGetNameAtIndex ¶
func JSPropertyNameArrayGetNameAtIndex(array JSPropertyNameArrayRef, index int) JSStringRef
JSPropertyNameArrayGetNameAtIndex calls the JavaScriptCore framework function JSPropertyNameArrayGetNameAtIndex.
func JSStringCreateWithCFString ¶
func JSStringCreateWithCFString(str corefoundation.CFStringRef) JSStringRef
JSStringCreateWithCFString calls the JavaScriptCore framework function JSStringCreateWithCFString.
func JSStringCreateWithCharacters ¶
func JSStringCreateWithCharacters(chars unsafe.Pointer, numChars int) JSStringRef
JSStringCreateWithCharacters calls the JavaScriptCore framework function JSStringCreateWithCharacters.
func JSStringCreateWithUTF8CString ¶
func JSStringCreateWithUTF8CString(str string) JSStringRef
JSStringCreateWithUTF8CString calls the JavaScriptCore framework function JSStringCreateWithUTF8CString.
func JSStringRetain ¶
func JSStringRetain(str JSStringRef) JSStringRef
JSStringRetain calls the JavaScriptCore framework function JSStringRetain.
func JSValueCreateJSONString ¶
func JSValueCreateJSONString(ctx JSContextRef, value JSValueRef, indent int, exception unsafe.Pointer) JSStringRef
JSValueCreateJSONString calls the JavaScriptCore framework function JSValueCreateJSONString.
func JSValueToStringCopy ¶
func JSValueToStringCopy(ctx JSContextRef, value JSValueRef, exception unsafe.Pointer) JSStringRef
JSValueToStringCopy calls the JavaScriptCore framework function JSValueToStringCopy.
func (JSStringRef) IsNil ¶ added in v0.18.0
func (h JSStringRef) IsNil() bool
IsNil reports whether JSStringRef is a NULL handle (it wraps no object). Call it before using a returned handle; a nil handle's methods panic.
type JSValueRef ¶ added in v0.18.0
JSValueRef is a handle for the opaque JSValueRef type.
func JSBigIntCreateWithDouble ¶
func JSBigIntCreateWithDouble(ctx JSContextRef, value float64, exception unsafe.Pointer) JSValueRef
JSBigIntCreateWithDouble calls the JavaScriptCore framework function JSBigIntCreateWithDouble.
func JSBigIntCreateWithInt64 ¶
func JSBigIntCreateWithInt64(ctx JSContextRef, integer int64, exception unsafe.Pointer) JSValueRef
JSBigIntCreateWithInt64 calls the JavaScriptCore framework function JSBigIntCreateWithInt64.
func JSBigIntCreateWithString ¶
func JSBigIntCreateWithString(ctx JSContextRef, str JSStringRef, exception unsafe.Pointer) JSValueRef
JSBigIntCreateWithString calls the JavaScriptCore framework function JSBigIntCreateWithString.
func JSBigIntCreateWithUInt64 ¶
func JSBigIntCreateWithUInt64(ctx JSContextRef, integer uint64, exception unsafe.Pointer) JSValueRef
JSBigIntCreateWithUInt64 calls the JavaScriptCore framework function JSBigIntCreateWithUInt64.
func JSEvaluateScript ¶
func JSEvaluateScript(ctx JSContextRef, script JSStringRef, thisObject JSObjectRef, sourceURL JSStringRef, startingLineNumber int, exception unsafe.Pointer) JSValueRef
JSEvaluateScript calls the JavaScriptCore framework function JSEvaluateScript.
func JSObjectCallAsFunction ¶
func JSObjectCallAsFunction(ctx JSContextRef, object JSObjectRef, thisObject JSObjectRef, argumentCount int, arguments unsafe.Pointer, exception unsafe.Pointer) JSValueRef
JSObjectCallAsFunction calls the JavaScriptCore framework function JSObjectCallAsFunction.
func JSObjectGetProperty ¶
func JSObjectGetProperty(ctx JSContextRef, object JSObjectRef, propertyName JSStringRef, exception unsafe.Pointer) JSValueRef
JSObjectGetProperty calls the JavaScriptCore framework function JSObjectGetProperty.
func JSObjectGetPropertyAtIndex ¶
func JSObjectGetPropertyAtIndex(ctx JSContextRef, object JSObjectRef, propertyIndex int, exception unsafe.Pointer) JSValueRef
JSObjectGetPropertyAtIndex calls the JavaScriptCore framework function JSObjectGetPropertyAtIndex.
func JSObjectGetPropertyForKey ¶
func JSObjectGetPropertyForKey(ctx JSContextRef, object JSObjectRef, propertyKey JSValueRef, exception unsafe.Pointer) JSValueRef
JSObjectGetPropertyForKey calls the JavaScriptCore framework function JSObjectGetPropertyForKey.
func JSObjectGetPrototype ¶
func JSObjectGetPrototype(ctx JSContextRef, object JSObjectRef) JSValueRef
JSObjectGetPrototype calls the JavaScriptCore framework function JSObjectGetPrototype.
func JSValueMakeBoolean ¶
func JSValueMakeBoolean(ctx JSContextRef, boolean bool) JSValueRef
JSValueMakeBoolean calls the JavaScriptCore framework function JSValueMakeBoolean.
func JSValueMakeFromJSONString ¶
func JSValueMakeFromJSONString(ctx JSContextRef, str JSStringRef) JSValueRef
JSValueMakeFromJSONString calls the JavaScriptCore framework function JSValueMakeFromJSONString.
func JSValueMakeNull ¶
func JSValueMakeNull(ctx JSContextRef) JSValueRef
JSValueMakeNull calls the JavaScriptCore framework function JSValueMakeNull.
func JSValueMakeNumber ¶
func JSValueMakeNumber(ctx JSContextRef, number float64) JSValueRef
JSValueMakeNumber calls the JavaScriptCore framework function JSValueMakeNumber.
func JSValueMakeString ¶
func JSValueMakeString(ctx JSContextRef, str JSStringRef) JSValueRef
JSValueMakeString calls the JavaScriptCore framework function JSValueMakeString.
func JSValueMakeSymbol ¶
func JSValueMakeSymbol(ctx JSContextRef, description JSStringRef) JSValueRef
JSValueMakeSymbol calls the JavaScriptCore framework function JSValueMakeSymbol.
func JSValueMakeUndefined ¶
func JSValueMakeUndefined(ctx JSContextRef) JSValueRef
JSValueMakeUndefined calls the JavaScriptCore framework function JSValueMakeUndefined.
func (JSValueRef) IsNil ¶ added in v0.18.0
func (h JSValueRef) IsNil() bool
IsNil reports whether JSValueRef is a NULL handle (it wraps no object). Call it before using a returned handle; a nil handle's methods panic.
type LaunchDataType ¶ added in v0.17.0
type LaunchDataType int32
const ( LaunchDataTypeDictionary LaunchDataType = 1 LaunchDataTypeArray LaunchDataType = 2 LaunchDataTypeFd LaunchDataType = 3 LaunchDataTypeInteger LaunchDataType = 4 LaunchDataTypeReal LaunchDataType = 5 LaunchDataTypeBool LaunchDataType = 6 LaunchDataTypeString LaunchDataType = 7 LaunchDataTypeOpaque LaunchDataType = 8 LaunchDataTypeErrno LaunchDataType = 9 LaunchDataTypeMachport LaunchDataType = 10 )
func (LaunchDataType) String ¶ added in v0.17.0
func (e LaunchDataType) String() string
String returns the LaunchDataType constant's name, or its numeric form when the value is not a known constant.
type MDLabelDomain ¶
type MDLabelDomain int32
These constants are used to specify a domain to MDLabelCreate().
const ( KMDLabelUserDomain MDLabelDomain = 0 KMDLabelLocalDomain MDLabelDomain = 1 )
func (MDLabelDomain) String ¶
func (e MDLabelDomain) String() string
String returns the MDLabelDomain constant's name, or its numeric form when the value is not a known constant.
type MDQueryOptionFlags ¶
type MDQueryOptionFlags int32
const ( KMDQuerySynchronous MDQueryOptionFlags = 1 KMDQueryWantsUpdates MDQueryOptionFlags = 4 KMDQueryAllowFSTranslation MDQueryOptionFlags = 8 )
func (MDQueryOptionFlags) String ¶
func (e MDQueryOptionFlags) String() string
String returns the MDQueryOptionFlags constant's name, or its numeric form when the value is not a known constant.
type MDQuerySortOptionFlags ¶
type MDQuerySortOptionFlags int32
const (
KMDQueryReverseSortOrderFlag MDQuerySortOptionFlags = 1
)
func (MDQuerySortOptionFlags) String ¶
func (e MDQuerySortOptionFlags) String() string
String returns the MDQuerySortOptionFlags constant's name, or its numeric form when the value is not a known constant.
type MachVMRangeFlags ¶ added in v0.17.0
type MachVMRangeFlags uint64
Bitmask — values may be combined with |.
const (
MachVMRangeFlagsNone MachVMRangeFlags = 0
)
func (MachVMRangeFlags) String ¶ added in v0.17.0
func (e MachVMRangeFlags) String() string
String returns the MachVMRangeFlags constant's name, or its numeric form when the value is not a known constant.
type MachVMRangeFlavor ¶ added in v0.17.0
type MachVMRangeFlavor uint32
const ( MachVMRangeFlavorInvalid MachVMRangeFlavor = 0 MachVMRangeFlavorV1 MachVMRangeFlavor = 1 )
func (MachVMRangeFlavor) String ¶ added in v0.17.0
func (e MachVMRangeFlavor) String() string
String returns the MachVMRangeFlavor constant's name, or its numeric form when the value is not a known constant.
type MachVMRangeTag ¶ added in v0.17.0
type MachVMRangeTag uint16
const ( MachVMRangeTagDefault MachVMRangeTag = 0 MachVMRangeTagData MachVMRangeTag = 1 MachVMRangeTagFixed MachVMRangeTag = 2 )
func (MachVMRangeTag) String ¶ added in v0.17.0
func (e MachVMRangeTag) String() string
String returns the MachVMRangeTag constant's name, or its numeric form when the value is not a known constant.
type ManagedValue ¶ added in v0.17.0
ManagedValue is an idiomatic wrapper over the Objective-C class JSManagedValue.
A JavaScript value with conditional retain behavior to provide automatic memory management.
func ManagedValueFromID ¶ added in v0.17.0
func ManagedValueFromID(id objc.ID) *ManagedValue
ManagedValueFromID adopts an existing Objective-C object as a ManagedValue (nil for 0), retaining it and registering a release finalizer.
func ManagedValueWithValue ¶ added in v0.17.0
func ManagedValueWithValue(value *Value) *ManagedValue
ManagedValueWithValue creates a managed value with the specified JavaScript value.
func ManagedValueWithValueAndOwner ¶ added in v0.17.0
func ManagedValueWithValueAndOwner(value *Value, owner obj.Object) *ManagedValue
ManagedValueWithValueAndOwner creates a managed value and associates it with an owner.
func NewManagedValueWithValue ¶ added in v0.17.0
func NewManagedValueWithValue(value *Value) *ManagedValue
NewManagedValueWithValue initializes a managed value with the specified JavaScript value.
func (*ManagedValue) Description ¶ added in v0.17.0
func (mv *ManagedValue) Description() string
Description returns the object's -description text.
func (*ManagedValue) IsEqual ¶ added in v0.17.0
func (mv *ManagedValue) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*ManagedValue) IsKind ¶ added in v0.17.0
func (mv *ManagedValue) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*ManagedValue) String ¶ added in v0.17.0
func (mv *ManagedValue) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*ManagedValue) Value ¶ added in v0.17.0
func (mv *ManagedValue) Value() *Value
Value returns the value.
type MpoFlags ¶ added in v0.17.0
type MpoFlags uint32
Bitmask — values may be combined with |.
const ( MpoFlagsPort MpoFlags = 0 MpoFlagsServicePort MpoFlags = 1024 MpoFlagsConnectionPort MpoFlags = 2048 MpoFlagsReplyPort MpoFlags = 4096 MpoFlagsWeakReplyPort MpoFlags = 16384 MpoFlagsNotificationPort MpoFlags = 17408 MpoFlagsExceptionPort MpoFlags = 32768 MpoFlagsConnectionPortWithPortArray MpoFlags = 65536 )
type OpaqueJSClass ¶
type OpaqueJSClass struct{}
type OpaqueJSContext ¶
type OpaqueJSContext struct{}
type OpaqueJSContextGroup ¶
type OpaqueJSContextGroup struct{}
type OpaqueJSPropertyNameAccumulator ¶
type OpaqueJSPropertyNameAccumulator struct{}
type OpaqueJSPropertyNameArray ¶
type OpaqueJSPropertyNameArray struct{}
type OpaqueJSString ¶
type OpaqueJSString struct{}
type OpaqueJSValue ¶
type OpaqueJSValue struct{}
type Perm ¶ added in v0.17.0
type Perm int32
const ( PermReadData Perm = 2 PermListDirectory Perm = 2 PermWriteData Perm = 4 PermAddFile Perm = 4 PermExecute Perm = 8 PermSearch Perm = 8 PermDelete Perm = 16 PermAppendData Perm = 32 PermAddSubdirectory Perm = 32 PermDeleteChild Perm = 64 PermReadAttributes Perm = 128 PermWriteAttributes Perm = 256 PermReadExtattributes Perm = 512 PermWriteExtattributes Perm = 1024 PermReadSecurity Perm = 2048 PermWriteSecurity Perm = 4096 PermChangeOwner Perm = 8192 PermSynchronize Perm = 1048576 )
type PtrauthKey ¶ added in v0.17.0
type PtrauthKey int32
const ( Ptrauth_key_none PtrauthKey = -1 Ptrauth_key_asia PtrauthKey = 0 Ptrauth_key_asib PtrauthKey = 1 Ptrauth_key_asda PtrauthKey = 2 Ptrauth_key_asdb PtrauthKey = 3 Ptrauth_key_process_independent_code PtrauthKey = 0 Ptrauth_key_process_dependent_code PtrauthKey = 1 Ptrauth_key_process_independent_data PtrauthKey = 2 Ptrauth_key_process_dependent_data PtrauthKey = 3 Ptrauth_key_return_address PtrauthKey = 1 Ptrauth_key_frame_pointer PtrauthKey = 3 Ptrauth_key_function_pointer PtrauthKey = 0 Ptrauth_key_block_function PtrauthKey = 0 Ptrauth_key_cxx_vtable_pointer PtrauthKey = 2 Ptrauth_key_method_list_pointer PtrauthKey = 2 Ptrauth_key_objc_isa_pointer PtrauthKey = 2 Ptrauth_key_objc_super_pointer PtrauthKey = 2 Ptrauth_key_objc_sel_pointer PtrauthKey = 3 Ptrauth_key_objc_class_ro_pointer PtrauthKey = 2 Ptrauth_key_block_descriptor_pointer PtrauthKey = 2 Ptrauth_key_init_fini_pointer PtrauthKey = 0 )
func (PtrauthKey) String ¶ added in v0.17.0
func (e PtrauthKey) String() string
String returns the PtrauthKey constant's name, or its numeric form when the value is not a known constant.
type RelationCondition ¶ added in v0.17.0
type RelationCondition uint32
const ( KJSRelationConditionUndefined RelationCondition = 0 KJSRelationConditionEqual RelationCondition = 1 KJSRelationConditionGreaterThan RelationCondition = 2 KJSRelationConditionLessThan RelationCondition = 3 )
func JSValueCompare ¶
func JSValueCompare(ctx JSContextRef, left JSValueRef, right JSValueRef, exception unsafe.Pointer) RelationCondition
JSValueCompare calls the JavaScriptCore framework function JSValueCompare.
func JSValueCompareDouble ¶
func JSValueCompareDouble(ctx JSContextRef, left JSValueRef, right float64, exception unsafe.Pointer) RelationCondition
JSValueCompareDouble calls the JavaScriptCore framework function JSValueCompareDouble.
func JSValueCompareInt64 ¶
func JSValueCompareInt64(ctx JSContextRef, left JSValueRef, right int64, exception unsafe.Pointer) RelationCondition
JSValueCompareInt64 calls the JavaScriptCore framework function JSValueCompareInt64.
func JSValueCompareUInt64 ¶
func JSValueCompareUInt64(ctx JSContextRef, left JSValueRef, right uint64, exception unsafe.Pointer) RelationCondition
JSValueCompareUInt64 calls the JavaScriptCore framework function JSValueCompareUInt64.
func (RelationCondition) String ¶ added in v0.17.0
func (e RelationCondition) String() string
String returns the RelationCondition constant's name, or its numeric form when the value is not a known constant.
type Type ¶ added in v0.17.0
type Type int32
Constants that identify the type of a JavaScript value.
func JSValueGetType ¶
func JSValueGetType(ctx JSContextRef, value JSValueRef) Type
JSValueGetType calls the JavaScriptCore framework function JSValueGetType.
type TypedArrayType ¶ added in v0.17.0
type TypedArrayType int32
The type of a JavaScript typed array object.
const ( KJSTypedArrayTypeInt8Array TypedArrayType = 0 KJSTypedArrayTypeInt16Array TypedArrayType = 1 KJSTypedArrayTypeInt32Array TypedArrayType = 2 KJSTypedArrayTypeUint8Array TypedArrayType = 3 KJSTypedArrayTypeUint8ClampedArray TypedArrayType = 4 KJSTypedArrayTypeUint16Array TypedArrayType = 5 KJSTypedArrayTypeUint32Array TypedArrayType = 6 KJSTypedArrayTypeFloat32Array TypedArrayType = 7 KJSTypedArrayTypeFloat64Array TypedArrayType = 8 KJSTypedArrayTypeArrayBuffer TypedArrayType = 9 KJSTypedArrayTypeNone TypedArrayType = 10 KJSTypedArrayTypeBigInt64Array TypedArrayType = 11 KJSTypedArrayTypeBigUint64Array TypedArrayType = 12 )
func JSValueGetTypedArrayType ¶
func JSValueGetTypedArrayType(ctx JSContextRef, value JSValueRef, exception unsafe.Pointer) TypedArrayType
JSValueGetTypedArrayType calls the JavaScriptCore framework function JSValueGetTypedArrayType.
func (TypedArrayType) String ¶ added in v0.17.0
func (e TypedArrayType) String() string
String returns the TypedArrayType constant's name, or its numeric form when the value is not a known constant.
type Value ¶ added in v0.17.0
Value is an idiomatic wrapper over the Objective-C class JSValue.
A JavaScript value.
func CurrentCallee ¶ added in v0.17.0
func CurrentCallee() *Value
CurrentCallee returns the currently executing JavaScript function.
func CurrentThis ¶ added in v0.17.0
func CurrentThis() *Value
CurrentThis returns the value of the this keyword in currently executing JavaScript code.
func ValueFromID ¶ added in v0.17.0
ValueFromID adopts an existing Objective-C object as a Value (nil for 0), retaining it and registering a release finalizer.
func ValueWithBoolInContext ¶ added in v0.17.0
ValueWithBoolInContext creates a JavaScript representation of the specified Boolean value.
func ValueWithDoubleInContext ¶ added in v0.17.0
ValueWithDoubleInContext creates a JavaScript representation of the specified floating-point value.
func ValueWithInt32InContext ¶ added in v0.17.0
ValueWithInt32InContext creates a JavaScript representation of the specified signed integer value.
func ValueWithJSValueRefInContext ¶ added in v0.17.0
func ValueWithJSValueRefInContext(value JSValueRef, context_ *Context) *Value
ValueWithJSValueRefInContext creates a JSValue, wrapping its C API counterpart.
func ValueWithNewArrayInContext ¶ added in v0.17.0
ValueWithNewArrayInContext creates a new, empty JavaScript array value.
func ValueWithNewBigIntFromDoubleInContext ¶ added in v0.17.0
ValueWithNewBigIntFromDoubleInContext create a new BigInt value from a double. If the value is not an integer, an exception is thrown.
func ValueWithNewBigIntFromInt64InContext ¶ added in v0.17.0
ValueWithNewBigIntFromInt64InContext create a new BigInt value from a <code>int64_t</code>.
func ValueWithNewBigIntFromStringInContext ¶ added in v0.17.0
ValueWithNewBigIntFromStringInContext create a new BigInt value from a numeric string. This is equivalent to calling the <code>BigInt</code> constructor from JavaScript with a string argument.
func ValueWithNewBigIntFromUInt64InContext ¶ added in v0.17.0
ValueWithNewBigIntFromUInt64InContext create a new BigInt value from a <code>uint64_t</code>.
func ValueWithNewErrorFromMessageInContext ¶ added in v0.17.0
ValueWithNewErrorFromMessageInContext creates a JavaScript error value with the specified error message.
func ValueWithNewObjectInContext ¶ added in v0.17.0
ValueWithNewObjectInContext creates a new, empty JavaScript object value.
func ValueWithNewPromiseInContextFromExecutor ¶ added in v0.17.0
func ValueWithNewPromiseInContextFromExecutor(context_ *Context, callback func(obj.Object, obj.Object)) *Value
ValueWithNewPromiseInContextFromExecutor creates a promise object using the specified executor callback.
func ValueWithNewPromiseRejectedWithReasonInContext ¶ added in v0.17.0
ValueWithNewPromiseRejectedWithReasonInContext creates a rejected promise object with the specified value.
func ValueWithNewPromiseResolvedWithResultInContext ¶ added in v0.17.0
ValueWithNewPromiseResolvedWithResultInContext creates a resolved promise object with the specified value.
func ValueWithNewRegularExpressionFromPatternFlagsInContext ¶ added in v0.17.0
func ValueWithNewRegularExpressionFromPatternFlagsInContext(pattern string, flags string, context_ *Context) *Value
ValueWithNewRegularExpressionFromPatternFlagsInContext creates a JavaScript regular expression value from the specified pattern.
func ValueWithNewSymbolFromDescriptionInContext ¶ added in v0.17.0
ValueWithNewSymbolFromDescriptionInContext creates a unique symbol object.
func ValueWithNullInContext ¶ added in v0.17.0
ValueWithNullInContext creates a JavaScript null value.
func ValueWithObjectInContext ¶ added in v0.17.0
ValueWithObjectInContext creates a JavaScript value by converting the specified native object.
func ValueWithPointInContext ¶ added in v0.17.0
func ValueWithPointInContext(point corefoundation.CGPoint, context_ *Context) *Value
ValueWithPointInContext create a JSValue from a CGPoint.
func ValueWithRangeInContext ¶ added in v0.17.0
func ValueWithRangeInContext(range_ foundation.NSRange, context_ *Context) *Value
ValueWithRangeInContext create a JSValue from a NSRange.
func ValueWithRectInContext ¶ added in v0.17.0
func ValueWithRectInContext(rect corefoundation.CGRect, context_ *Context) *Value
ValueWithRectInContext create a JSValue from a CGRect.
func ValueWithSizeInContext ¶ added in v0.17.0
func ValueWithSizeInContext(size corefoundation.CGSize, context_ *Context) *Value
ValueWithSizeInContext create a JSValue from a CGSize.
func ValueWithUInt32InContext ¶ added in v0.17.0
ValueWithUInt32InContext creates a JavaScript representation of the specified unsigned integer value.
func ValueWithUndefinedInContext ¶ added in v0.17.0
ValueWithUndefinedInContext creates a JavaScript undefined value.
func (*Value) CallWithArguments ¶ added in v0.17.0
CallWithArguments invokes the value as a JavaScript function.
func (*Value) CompareDouble ¶ added in v0.17.0
func (v_ *Value) CompareDouble(other float64) RelationCondition
CompareDouble compare a JSValue with a double. The JSValue is converted to a double according to the rules specified by the JavaScript language then compared with <code>other</code>.
func (*Value) CompareInt64 ¶ added in v0.17.0
func (v_ *Value) CompareInt64(other int64) RelationCondition
CompareInt64 compare a JSValue with a <code>int64_t</code>. The JSValue is converted to an integer according to the rules specified by the JavaScript language then compared with <code>other</code>.
func (*Value) CompareJSValue ¶ added in v0.17.0
func (v_ *Value) CompareJSValue(other *Value) RelationCondition
CompareJSValue compare two JSValues. 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.
func (*Value) CompareUInt64 ¶ added in v0.17.0
func (v_ *Value) CompareUInt64(other uint64) RelationCondition
CompareUInt64 compare a JSValue with a <code>uint64_t</code>. The JSValue is converted to an integer according to the rules specified by the JavaScript language then compared with <code>other</code>.
func (*Value) ConstructWithArguments ¶ added in v0.17.0
ConstructWithArguments invokes the value as a JavaScript constructor.
func (*Value) Context ¶ added in v0.17.0
Context returns the JSContext that this value originates from.
func (*Value) DefinePropertyDescriptor ¶ added in v0.17.0
DefinePropertyDescriptor defines a property on the JavaScript object value or modifies a property’s definition.
func (*Value) DeleteProperty ¶ added in v0.17.0
DeleteProperty deletes the named property from the JavaScript object value.
func (*Value) Description ¶ added in v0.17.0
Description returns the object's -description text.
func (*Value) HasProperty ¶ added in v0.17.0
HasProperty returns a Boolean value indicating whether the JavaScript value has a defined property with the specified name.
func (*Value) InvokeMethodWithArguments ¶ added in v0.17.0
InvokeMethodWithArguments calls the named JavaScript method on the value.
func (*Value) IsBoolean ¶ added in v0.17.0
IsBoolean reports whether check if a JSValue is a boolean.
func (*Value) IsEqual ¶ added in v0.17.0
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*Value) IsEqualToObject ¶ added in v0.17.0
IsEqualToObject compares the value to another for strict equality.
func (*Value) IsEqualWithTypeCoercionToObject ¶ added in v0.17.0
IsEqualWithTypeCoercionToObject compares the value to another for equivalence, allowing type conversion.
func (*Value) IsInstanceOf ¶ added in v0.17.0
IsInstanceOf returns a Boolean value indicating whether the value is an instance of another JavaScript object value.
func (*Value) IsKind ¶ added in v0.17.0
IsKind reports whether the object is an instance of the named class or a subclass.
func (*Value) IsNull ¶ added in v0.17.0
IsNull reports whether check if a JSValue corresponds to the JavaScript value <code>null</code>.
func (*Value) IsNumber ¶ added in v0.17.0
IsNumber reports whether check if a JSValue is a number. In JavaScript, there is no differentiation between types of numbers. Semantically all numbers behave like doubles except in special cases like bit operations.
func (*Value) IsUndefined ¶ added in v0.17.0
IsUndefined reports whether check if a JSValue corresponds to the JavaScript value <code>undefined</code>.
func (*Value) JSValueRef ¶ added in v0.17.0
func (v_ *Value) JSValueRef() JSValueRef
JSValueRef returns the js value ref.
func (*Value) ObjectAtIndexedSubscript ¶ added in v0.17.0
ObjectAtIndexedSubscript returns the value’s JavaScript property at the specified index, allowing subscript syntax.
func (*Value) ObjectForKeyedSubscript ¶ added in v0.17.0
ObjectForKeyedSubscript returns the value’s JavaScript property named with the specified key, allowing subscript syntax.
func (*Value) SetObjectAtIndexedSubscript ¶ added in v0.17.0
SetObjectAtIndexedSubscript sets the value’s JavaScript property at the specified index, allowing subscript syntax.
func (*Value) SetObjectForKeyedSubscript ¶ added in v0.17.0
SetObjectForKeyedSubscript sets the value’s JavaScript property named with the specified key, allowing subscript syntax.
func (*Value) SetValueAtIndex ¶ added in v0.17.0
SetValueAtIndex sets the value at the specified numeric index in the JavaScript object value.
func (*Value) SetValueForProperty ¶ added in v0.17.0
SetValueForProperty sets the value of the named property in the JavaScript object value.
func (*Value) String ¶ added in v0.17.0
String returns the object's -description text, so a wrapper prints usefully under fmt.
func (*Value) ToBool ¶ added in v0.17.0
ToBool reports whether converts the JavaScript value to a native Boolean value.
func (*Value) ToDate ¶ added in v0.17.0
ToDate returns converts the JavaScript value to a date object.
func (*Value) ToDictionary ¶ added in v0.17.0
ToDictionary returns converts the JavaScript value to a dictionary.
func (*Value) ToDouble ¶ added in v0.17.0
ToDouble returns converts the JavaScript value to a native floating-point value.
func (*Value) ToInt32 ¶ added in v0.17.0
ToInt32 returns converts the JavaScript value to a native signed integer value.
func (*Value) ToInt64 ¶ added in v0.17.0
ToInt64 returns convert a JSValue to a <code>int64_t</code>. 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>.
func (*Value) ToNumber ¶ added in v0.17.0
func (v_ *Value) ToNumber() *foundation.Number
ToNumber returns converts the JavaScript value to a NSNumber object.
func (*Value) ToObject ¶ added in v0.17.0
ToObject returns converts the JavaScript value to a native object.
func (*Value) ToPoint ¶ added in v0.17.0
func (v_ *Value) ToPoint() corefoundation.CGPoint
ToPoint returns converts the value to a point structure.
func (*Value) ToRange ¶ added in v0.17.0
func (v_ *Value) ToRange() foundation.NSRange
ToRange returns converts the value to a range.
func (*Value) ToRect ¶ added in v0.17.0
func (v_ *Value) ToRect() corefoundation.CGRect
ToRect returns converts the value to a rectangle structure.
func (*Value) ToSize ¶ added in v0.17.0
func (v_ *Value) ToSize() corefoundation.CGSize
ToSize returns converts the value to a size.
func (*Value) ToString ¶ added in v0.17.0
ToString returns converts the JavaScript value to a native string.
func (*Value) ToUInt32 ¶ added in v0.17.0
ToUInt32 returns converts the JavaScript value to a native unsigned integer value.
func (*Value) ToUInt64 ¶ added in v0.17.0
ToUInt64 returns convert a JSValue to a <code>uint64_t</code>. 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>.
func (*Value) ValueAtIndex ¶ added in v0.17.0
ValueAtIndex returns the value at the specified numeric index in the JavaScript object value.
type VirtualMachine ¶ added in v0.17.0
VirtualMachine is an idiomatic wrapper over the Objective-C class JSVirtualMachine.
A self-contained environment for JavaScript execution.
func NewVirtualMachine ¶ added in v0.17.0
func NewVirtualMachine() *VirtualMachine
NewVirtualMachine creates a new VirtualMachine.
func VirtualMachineFromID ¶ added in v0.17.0
func VirtualMachineFromID(id objc.ID) *VirtualMachine
VirtualMachineFromID adopts an existing Objective-C object as a VirtualMachine (nil for 0), retaining it and registering a release finalizer.
func (*VirtualMachine) AddManagedReferenceWithOwner ¶ added in v0.17.0
func (vm *VirtualMachine) AddManagedReferenceWithOwner(object obj.Object, owner obj.Object)
AddManagedReferenceWithOwner notifies the JavaScriptCore virtual machine of an external object relationship.
func (*VirtualMachine) Description ¶ added in v0.17.0
func (vm *VirtualMachine) Description() string
Description returns the object's -description text.
func (*VirtualMachine) IsEqual ¶ added in v0.17.0
func (vm *VirtualMachine) IsEqual(other obj.Object) bool
IsEqual reports Objective-C equality (isEqual:) with another object.
func (*VirtualMachine) IsKind ¶ added in v0.17.0
func (vm *VirtualMachine) IsKind(className string) bool
IsKind reports whether the object is an instance of the named class or a subclass.
func (*VirtualMachine) RemoveManagedReferenceWithOwner ¶ added in v0.17.0
func (vm *VirtualMachine) RemoveManagedReferenceWithOwner(object obj.Object, owner obj.Object)
RemoveManagedReferenceWithOwner notifies the JavaScriptCore virtual machine that a previously registered object relationship no longer exists.
func (*VirtualMachine) String ¶ added in v0.17.0
func (vm *VirtualMachine) String() string
String returns the object's -description text, so a wrapper prints usefully under fmt.
type VirtualMemoryGuardExceptionCode ¶ added in v0.17.0
type VirtualMemoryGuardExceptionCode uint32
const ( KGUARD_EXC_DEALLOC_GAP VirtualMemoryGuardExceptionCode = 1 KGUARD_EXC_RECLAIM_COPYIO_FAILURE VirtualMemoryGuardExceptionCode = 2 KGUARD_EXC_RECLAIM_INDEX_FAILURE VirtualMemoryGuardExceptionCode = 4 KGUARD_EXC_RECLAIM_DEALLOCATE_FAILURE VirtualMemoryGuardExceptionCode = 8 KGUARD_EXC_RECLAIM_ACCOUNTING_FAILURE VirtualMemoryGuardExceptionCode = 9 KGUARD_EXC_SEC_IOPL_ON_EXEC_PAGE VirtualMemoryGuardExceptionCode = 10 KGUARD_EXC_SEC_EXEC_ON_IOPL_PAGE VirtualMemoryGuardExceptionCode = 11 KGUARD_EXC_SEC_UPL_WRITE_ON_EXEC_REGION VirtualMemoryGuardExceptionCode = 12 KGUARD_EXC_LARGE_ALLOCATION_TELEMETRY VirtualMemoryGuardExceptionCode = 13 KGUARD_EXC_SEC_ACCESS_FAULT VirtualMemoryGuardExceptionCode = 98 KGUARD_EXC_SEC_ASYNC_ACCESS_FAULT VirtualMemoryGuardExceptionCode = 99 KGUARD_EXC_SEC_COPY_DENIED VirtualMemoryGuardExceptionCode = 100 KGUARD_EXC_SEC_SHARING_DENIED VirtualMemoryGuardExceptionCode = 101 KGUARD_EXC_MTE_SYNC_FAULT VirtualMemoryGuardExceptionCode = 200 KGUARD_EXC_MTE_ASYNC_USER_FAULT VirtualMemoryGuardExceptionCode = 201 KGUARD_EXC_MTE_ASYNC_KERN_FAULT VirtualMemoryGuardExceptionCode = 202 KGUARD_EXC_GUARD_OBJECT_ASYNC_USER_FAULT VirtualMemoryGuardExceptionCode = 203 KGUARD_EXC_GUARD_OBJECT_ASYNC_KERN_FAULT VirtualMemoryGuardExceptionCode = 204 )
func (VirtualMemoryGuardExceptionCode) String ¶ added in v0.17.0
func (e VirtualMemoryGuardExceptionCode) String() string
String returns the VirtualMemoryGuardExceptionCode constant's name, or its numeric form when the value is not a known constant.
type XpcListenerCreateFlags ¶ added in v0.17.0
type XpcListenerCreateFlags uint64
Bitmask — values may be combined with |.
const ( XpcListenerCreateFlagsNone XpcListenerCreateFlags = 0 XpcListenerCreateFlagsInactive XpcListenerCreateFlags = 1 XpcListenerCreateFlagsForceMach XpcListenerCreateFlags = 2 XpcListenerCreateFlagsForceXpcservice XpcListenerCreateFlags = 4 )
func (XpcListenerCreateFlags) String ¶ added in v0.17.0
func (e XpcListenerCreateFlags) String() string
String returns the XpcListenerCreateFlags constant's name, or its numeric form when the value is not a known constant.
type XpcSessionCreateFlags ¶ added in v0.17.0
type XpcSessionCreateFlags uint64
Bitmask — values may be combined with |.
const ( XpcSessionCreateFlagsNone XpcSessionCreateFlags = 0 XpcSessionCreateFlagsInactive XpcSessionCreateFlags = 1 XpcSessionCreateFlagsMachPrivileged XpcSessionCreateFlags = 2 )
func (XpcSessionCreateFlags) String ¶ added in v0.17.0
func (e XpcSessionCreateFlags) String() string
String returns the XpcSessionCreateFlags constant's name, or its numeric form when the value is not a known constant.
Source Files
¶
- JSContext_generated.go
- JSManagedValue_generated.go
- JSValue_generated.go
- JSVirtualMachine_generated.go
- doc.go
- javascriptcore_cfunctions_generated.go
- javascriptcore_classmethods_generated.go
- javascriptcore_constants_generated.go
- javascriptcore_enums_generated.go
- javascriptcore_protocols_generated.go
- javascriptcore_runtime_generated.go
- javascriptcore_structs_generated.go