Documentation
¶
Overview ¶
Package javascriptcore provides purego-based Go bindings for the macOS JavaScriptCore framework.
Apple documentation: https://developer.apple.com/documentation/javascriptcore
Index ¶
- Constants
- func JSBigIntCreateWithDouble(ctx unsafe.Pointer, value float64, exception unsafe.Pointer) unsafe.Pointer
- func JSBigIntCreateWithInt64(ctx unsafe.Pointer, integer int64, exception unsafe.Pointer) unsafe.Pointer
- func JSBigIntCreateWithString(ctx unsafe.Pointer, string_ unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
- func JSBigIntCreateWithUInt64(ctx unsafe.Pointer, integer uint64, exception unsafe.Pointer) unsafe.Pointer
- func JSCheckScriptSyntax(ctx unsafe.Pointer, script unsafe.Pointer, sourceURL unsafe.Pointer, ...) bool
- func JSClassCreate(definition *JSClassDefinition) unsafe.Pointer
- func JSClassRelease(jsClass unsafe.Pointer)
- func JSClassRetain(jsClass unsafe.Pointer) unsafe.Pointer
- func JSContextCurrentArguments() *foundation.NSArray[objc.ID]
- func JSContextGetGlobalContext(ctx unsafe.Pointer) unsafe.Pointer
- func JSContextGetGlobalObject(ctx unsafe.Pointer) unsafe.Pointer
- func JSContextGetGroup(ctx unsafe.Pointer) unsafe.Pointer
- func JSContextGroupCreate() unsafe.Pointer
- func JSContextGroupRelease(group unsafe.Pointer)
- func JSContextGroupRetain(group unsafe.Pointer) unsafe.Pointer
- func JSEvaluateScript(ctx unsafe.Pointer, script unsafe.Pointer, thisObject unsafe.Pointer, ...) unsafe.Pointer
- func JSGarbageCollect(ctx unsafe.Pointer)
- func JSGlobalContextCopyName(ctx unsafe.Pointer) unsafe.Pointer
- func JSGlobalContextCreate(globalObjectClass unsafe.Pointer) unsafe.Pointer
- func JSGlobalContextCreateInGroup(group unsafe.Pointer, globalObjectClass unsafe.Pointer) unsafe.Pointer
- func JSGlobalContextIsInspectable(ctx unsafe.Pointer) bool
- func JSGlobalContextRelease(ctx unsafe.Pointer)
- func JSGlobalContextRetain(ctx unsafe.Pointer) unsafe.Pointer
- func JSGlobalContextSetInspectable(ctx unsafe.Pointer, inspectable bool)
- func JSGlobalContextSetName(ctx unsafe.Pointer, name unsafe.Pointer)
- func JSObjectCallAsConstructor(ctx unsafe.Pointer, object unsafe.Pointer, argumentCount uint, ...) unsafe.Pointer
- func JSObjectCallAsFunction(ctx unsafe.Pointer, object unsafe.Pointer, thisObject unsafe.Pointer, ...) unsafe.Pointer
- func JSObjectCopyPropertyNames(ctx unsafe.Pointer, object unsafe.Pointer) unsafe.Pointer
- func JSObjectDeleteProperty(ctx unsafe.Pointer, object unsafe.Pointer, propertyName unsafe.Pointer, ...) bool
- func JSObjectDeletePropertyForKey(ctx unsafe.Pointer, object unsafe.Pointer, propertyKey unsafe.Pointer, ...) bool
- func JSObjectGetArrayBufferByteLength(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) uint
- func JSObjectGetArrayBufferBytesPtr(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
- func JSObjectGetPrivate(object unsafe.Pointer) unsafe.Pointer
- func JSObjectGetProperty(ctx unsafe.Pointer, object unsafe.Pointer, propertyName unsafe.Pointer, ...) unsafe.Pointer
- func JSObjectGetPropertyAtIndex(ctx unsafe.Pointer, object unsafe.Pointer, propertyIndex uint, ...) unsafe.Pointer
- func JSObjectGetPropertyForKey(ctx unsafe.Pointer, object unsafe.Pointer, propertyKey unsafe.Pointer, ...) unsafe.Pointer
- func JSObjectGetPrototype(ctx unsafe.Pointer, object unsafe.Pointer) unsafe.Pointer
- func JSObjectGetTypedArrayBuffer(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
- func JSObjectGetTypedArrayByteLength(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) uint
- func JSObjectGetTypedArrayByteOffset(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) uint
- func JSObjectGetTypedArrayBytesPtr(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
- func JSObjectGetTypedArrayLength(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) uint
- func JSObjectHasProperty(ctx unsafe.Pointer, object unsafe.Pointer, propertyName unsafe.Pointer) bool
- func JSObjectHasPropertyForKey(ctx unsafe.Pointer, object unsafe.Pointer, propertyKey unsafe.Pointer, ...) bool
- func JSObjectIsConstructor(ctx unsafe.Pointer, object unsafe.Pointer) bool
- func JSObjectIsFunction(ctx unsafe.Pointer, object unsafe.Pointer) bool
- func JSObjectMake(ctx unsafe.Pointer, jsClass unsafe.Pointer, data unsafe.Pointer) unsafe.Pointer
- func JSObjectMakeArray(ctx unsafe.Pointer, argumentCount uint, arguments unsafe.Pointer, ...) unsafe.Pointer
- func JSObjectMakeArrayBufferWithBytesNoCopy(ctx unsafe.Pointer, bytes_ unsafe.Pointer, byteLength uint, ...) unsafe.Pointer
- func JSObjectMakeConstructor(ctx unsafe.Pointer, jsClass unsafe.Pointer, callAsConstructor unsafe.Pointer) unsafe.Pointer
- func JSObjectMakeDate(ctx unsafe.Pointer, argumentCount uint, arguments unsafe.Pointer, ...) unsafe.Pointer
- func JSObjectMakeDeferredPromise(ctx unsafe.Pointer, resolve unsafe.Pointer, reject unsafe.Pointer, ...) unsafe.Pointer
- func JSObjectMakeError(ctx unsafe.Pointer, argumentCount uint, arguments unsafe.Pointer, ...) unsafe.Pointer
- func JSObjectMakeFunction(ctx unsafe.Pointer, name unsafe.Pointer, parameterCount uint, ...) unsafe.Pointer
- func JSObjectMakeFunctionWithCallback(ctx unsafe.Pointer, name unsafe.Pointer, callAsFunction unsafe.Pointer) unsafe.Pointer
- func JSObjectMakeRegExp(ctx unsafe.Pointer, argumentCount uint, arguments unsafe.Pointer, ...) unsafe.Pointer
- func JSObjectMakeTypedArray(ctx unsafe.Pointer, arrayType JSTypedArrayType, length uint, ...) unsafe.Pointer
- func JSObjectMakeTypedArrayWithArrayBuffer(ctx unsafe.Pointer, arrayType JSTypedArrayType, buffer unsafe.Pointer, ...) unsafe.Pointer
- func JSObjectMakeTypedArrayWithArrayBufferAndOffset(ctx unsafe.Pointer, arrayType JSTypedArrayType, buffer unsafe.Pointer, ...) unsafe.Pointer
- func JSObjectMakeTypedArrayWithBytesNoCopy(ctx unsafe.Pointer, arrayType JSTypedArrayType, bytes_ unsafe.Pointer, ...) unsafe.Pointer
- func JSObjectSetPrivate(object unsafe.Pointer, data unsafe.Pointer) bool
- func JSObjectSetProperty(ctx unsafe.Pointer, object unsafe.Pointer, propertyName unsafe.Pointer, ...)
- func JSObjectSetPropertyAtIndex(ctx unsafe.Pointer, object unsafe.Pointer, propertyIndex uint, ...)
- func JSObjectSetPropertyForKey(ctx unsafe.Pointer, object unsafe.Pointer, propertyKey unsafe.Pointer, ...)
- func JSObjectSetPrototype(ctx unsafe.Pointer, object unsafe.Pointer, value unsafe.Pointer)
- func JSPropertyDescriptorConfigurableKey() *foundation.NSString
- func JSPropertyDescriptorEnumerableKey() *foundation.NSString
- func JSPropertyDescriptorGetKey() *foundation.NSString
- func JSPropertyDescriptorSetKey() *foundation.NSString
- func JSPropertyDescriptorValueKey() *foundation.NSString
- func JSPropertyDescriptorWritableKey() *foundation.NSString
- func JSPropertyNameAccumulatorAddName(accumulator unsafe.Pointer, propertyName unsafe.Pointer)
- func JSPropertyNameArrayGetCount(array unsafe.Pointer) uint
- func JSPropertyNameArrayGetNameAtIndex(array unsafe.Pointer, index uint) unsafe.Pointer
- func JSPropertyNameArrayRelease(array unsafe.Pointer)
- func JSPropertyNameArrayRetain(array unsafe.Pointer) unsafe.Pointer
- func JSStringCopyCFString(alloc unsafe.Pointer, string_ unsafe.Pointer) unsafe.Pointer
- func JSStringCreateWithCFString(string_ unsafe.Pointer) unsafe.Pointer
- func JSStringCreateWithCharacters(chars *uint16, numChars uint) unsafe.Pointer
- func JSStringCreateWithUTF8CString(string_ string) unsafe.Pointer
- func JSStringGetCharactersPtr(string_ unsafe.Pointer) *uint16
- func JSStringGetLength(string_ unsafe.Pointer) uint
- func JSStringGetMaximumUTF8CStringSize(string_ unsafe.Pointer) uint
- func JSStringGetUTF8CString(string_ unsafe.Pointer, buffer string, bufferSize uint) uint
- func JSStringIsEqual(a unsafe.Pointer, b unsafe.Pointer) bool
- func JSStringIsEqualToUTF8CString(a unsafe.Pointer, b string) bool
- func JSStringRelease(string_ unsafe.Pointer)
- func JSStringRetain(string_ unsafe.Pointer) unsafe.Pointer
- func JSValueCreateJSONString(ctx unsafe.Pointer, value unsafe.Pointer, indent uint, ...) unsafe.Pointer
- func JSValueIsArray(ctx unsafe.Pointer, value unsafe.Pointer) bool
- func JSValueIsBigInt(ctx unsafe.Pointer, value unsafe.Pointer) bool
- func JSValueIsBoolean(ctx unsafe.Pointer, value unsafe.Pointer) bool
- func JSValueIsDate(ctx unsafe.Pointer, value unsafe.Pointer) bool
- func JSValueIsEqual(ctx unsafe.Pointer, a unsafe.Pointer, b unsafe.Pointer, ...) bool
- func JSValueIsInstanceOfConstructor(ctx unsafe.Pointer, value unsafe.Pointer, constructor unsafe.Pointer, ...) bool
- func JSValueIsNull(ctx unsafe.Pointer, value unsafe.Pointer) bool
- func JSValueIsNumber(ctx unsafe.Pointer, value unsafe.Pointer) bool
- func JSValueIsObject(ctx unsafe.Pointer, value unsafe.Pointer) bool
- func JSValueIsObjectOfClass(ctx unsafe.Pointer, value unsafe.Pointer, jsClass unsafe.Pointer) bool
- func JSValueIsStrictEqual(ctx unsafe.Pointer, a unsafe.Pointer, b unsafe.Pointer) bool
- func JSValueIsString(ctx unsafe.Pointer, value unsafe.Pointer) bool
- func JSValueIsSymbol(ctx unsafe.Pointer, value unsafe.Pointer) bool
- func JSValueIsUndefined(ctx unsafe.Pointer, value unsafe.Pointer) bool
- func JSValueMakeBoolean(ctx unsafe.Pointer, boolean bool) unsafe.Pointer
- func JSValueMakeFromJSONString(ctx unsafe.Pointer, string_ unsafe.Pointer) unsafe.Pointer
- func JSValueMakeNull(ctx unsafe.Pointer) unsafe.Pointer
- func JSValueMakeNumber(ctx unsafe.Pointer, number float64) unsafe.Pointer
- func JSValueMakeString(ctx unsafe.Pointer, string_ unsafe.Pointer) unsafe.Pointer
- func JSValueMakeSymbol(ctx unsafe.Pointer, description unsafe.Pointer) unsafe.Pointer
- func JSValueMakeUndefined(ctx unsafe.Pointer) unsafe.Pointer
- func JSValueProtect(ctx unsafe.Pointer, value unsafe.Pointer)
- func JSValueToBoolean(ctx unsafe.Pointer, value unsafe.Pointer) bool
- func JSValueToInt32(ctx unsafe.Pointer, value unsafe.Pointer, exception unsafe.Pointer) int32
- func JSValueToInt64(ctx unsafe.Pointer, value unsafe.Pointer, exception unsafe.Pointer) int64
- func JSValueToNumber(ctx unsafe.Pointer, value unsafe.Pointer, exception unsafe.Pointer) float64
- func JSValueToObject(ctx unsafe.Pointer, value unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
- func JSValueToStringCopy(ctx unsafe.Pointer, value unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
- func JSValueToUInt32(ctx unsafe.Pointer, value unsafe.Pointer, exception unsafe.Pointer) uint32
- func JSValueToUInt64(ctx unsafe.Pointer, value unsafe.Pointer, exception unsafe.Pointer) uint64
- func JSValueUnprotect(ctx unsafe.Pointer, value unsafe.Pointer)
- func SymbolAvailable(symbol string) bool
- type Acl_entry_id_t
- type Acl_flag_t
- type Acl_perm_t
- type Acl_tag_t
- type Acl_type_t
- type Clockid_t
- type Dispatch_autorelease_frequency_t
- type Dispatch_block_flags_t
- type Filesec_property_t
- type Idtype_t
- type Ipc_info_object_type_t
- type JSClassDefinition
- type JSContext
- func (o *JSContext) EvaluateScript(script *foundation.NSString) *JSValue
- func (o *JSContext) EvaluateScriptWithSourceURL(script *foundation.NSString, sourceURL *foundation.NSURL) *JSValue
- func (o *JSContext) Exception() *JSValue
- func (o *JSContext) ExceptionHandler() objc.Block
- func (o *JSContext) GlobalObject() *JSValue
- func (o *JSContext) Init() *JSContext
- func (o *JSContext) InitWithVirtualMachine(virtualMachine *JSVirtualMachine) *JSContext
- func (o *JSContext) IsInspectable() bool
- func (o *JSContext) JSGlobalContextRef() unsafe.Pointer
- func (o *JSContext) Name() *foundation.NSString
- func (o *JSContext) ObjectForKeyedSubscript(key objc.ID) *JSValue
- func (o *JSContext) SetException(exception *JSValue)
- func (o *JSContext) SetExceptionHandler(exceptionHandler func(*JSContext, *JSValue))
- func (o *JSContext) SetInspectable(inspectable bool)
- func (o *JSContext) SetName(name *foundation.NSString)
- func (o *JSContext) SetObjectForKeyedSubscript(object objc.ID, key *foundation.NSObject)
- func (o *JSContext) VirtualMachine() *JSVirtualMachine
- type JSExport
- type JSManagedValue
- type JSRelationCondition
- func JSValueCompare(ctx unsafe.Pointer, left unsafe.Pointer, right unsafe.Pointer, ...) JSRelationCondition
- func JSValueCompareDouble(ctx unsafe.Pointer, left unsafe.Pointer, right float64, ...) JSRelationCondition
- func JSValueCompareInt64(ctx unsafe.Pointer, left unsafe.Pointer, right int64, exception unsafe.Pointer) JSRelationCondition
- func JSValueCompareUInt64(ctx unsafe.Pointer, left unsafe.Pointer, right uint64, ...) JSRelationCondition
- type JSStaticFunction
- type JSStaticValue
- type JSType
- type JSTypedArrayType
- type JSValue
- func JSContextCurrentCallee() *JSValue
- func JSContextCurrentThis() *JSValue
- func JSValueFromID(id objc.ID) *JSValue
- func JSValueValueWithBoolInContext(value bool, context_ *JSContext) *JSValue
- func JSValueValueWithDoubleInContext(value float64, context_ *JSContext) *JSValue
- func JSValueValueWithInt32InContext(value int32, context_ *JSContext) *JSValue
- func JSValueValueWithJSValueRefInContext(value unsafe.Pointer, context_ *JSContext) *JSValue
- func JSValueValueWithNewArrayInContext(context_ *JSContext) *JSValue
- func JSValueValueWithNewBigIntFromDoubleInContext(value float64, context_ *JSContext) *JSValue
- func JSValueValueWithNewBigIntFromInt64InContext(int64 int64, context_ *JSContext) *JSValue
- func JSValueValueWithNewBigIntFromStringInContext(string_ *foundation.NSString, context_ *JSContext) *JSValue
- func JSValueValueWithNewBigIntFromUInt64InContext(uint64 uint64, context_ *JSContext) *JSValue
- func JSValueValueWithNewErrorFromMessageInContext(message *foundation.NSString, context_ *JSContext) *JSValue
- func JSValueValueWithNewObjectInContext(context_ *JSContext) *JSValue
- func JSValueValueWithNewPromiseInContextFromExecutor(context_ *JSContext, callback func(*JSValue, *JSValue)) *JSValue
- func JSValueValueWithNewPromiseRejectedWithReasonInContext(reason objc.ID, context_ *JSContext) *JSValue
- func JSValueValueWithNewPromiseResolvedWithResultInContext(result objc.ID, context_ *JSContext) *JSValue
- func JSValueValueWithNewRegularExpressionFromPatternFlagsInContext(pattern *foundation.NSString, flags *foundation.NSString, context_ *JSContext) *JSValue
- func JSValueValueWithNewSymbolFromDescriptionInContext(description *foundation.NSString, context_ *JSContext) *JSValue
- func JSValueValueWithNullInContext(context_ *JSContext) *JSValue
- func JSValueValueWithObjectInContext(value objc.ID, context_ *JSContext) *JSValue
- func JSValueValueWithPointInContext(point corefoundation.CGPoint, context_ *JSContext) *JSValue
- func JSValueValueWithRangeInContext(range_ foundation.NSRange, context_ *JSContext) *JSValue
- func JSValueValueWithRectInContext(rect corefoundation.CGRect, context_ *JSContext) *JSValue
- func JSValueValueWithSizeInContext(size corefoundation.CGSize, context_ *JSContext) *JSValue
- func JSValueValueWithUInt32InContext(value uint32, context_ *JSContext) *JSValue
- func JSValueValueWithUndefinedInContext(context_ *JSContext) *JSValue
- func (o *JSValue) CallWithArguments(arguments *foundation.NSArray[objc.ID]) *JSValue
- func (o *JSValue) CompareDouble(other float64) JSRelationCondition
- func (o *JSValue) CompareInt64(other int64) JSRelationCondition
- func (o *JSValue) CompareJSValue(other *JSValue) JSRelationCondition
- func (o *JSValue) CompareUInt64(other uint64) JSRelationCondition
- func (o *JSValue) ConstructWithArguments(arguments *foundation.NSArray[objc.ID]) *JSValue
- func (o *JSValue) Context() *JSContext
- func (o *JSValue) DefinePropertyDescriptor(property objc.ID, descriptor objc.ID)
- func (o *JSValue) DeleteProperty(property objc.ID) bool
- func (o *JSValue) HasProperty(property objc.ID) bool
- func (o *JSValue) InvokeMethodWithArguments(method *foundation.NSString, arguments *foundation.NSArray[objc.ID]) *JSValue
- func (o *JSValue) IsArray() bool
- func (o *JSValue) IsBigInt() bool
- func (o *JSValue) IsBoolean() bool
- func (o *JSValue) IsDate() bool
- func (o *JSValue) IsEqualToObject(value objc.ID) bool
- func (o *JSValue) IsEqualWithTypeCoercionToObject(value objc.ID) bool
- func (o *JSValue) IsInstanceOf(value objc.ID) bool
- func (o *JSValue) IsNull() bool
- func (o *JSValue) IsNumber() bool
- func (o *JSValue) IsObject() bool
- func (o *JSValue) IsString() bool
- func (o *JSValue) IsSymbol() bool
- func (o *JSValue) IsUndefined() bool
- func (o *JSValue) JSValueRef() unsafe.Pointer
- func (o *JSValue) ObjectAtIndexedSubscript(index uint) *JSValue
- func (o *JSValue) ObjectForKeyedSubscript(key objc.ID) *JSValue
- func (o *JSValue) SetObjectAtIndexedSubscript(object objc.ID, index uint)
- func (o *JSValue) SetObjectForKeyedSubscript(object objc.ID, key objc.ID)
- func (o *JSValue) SetValueAtIndex(value objc.ID, index uint)
- func (o *JSValue) SetValueForProperty(value objc.ID, property objc.ID)
- func (o *JSValue) ToArray() *foundation.NSArray[objc.ID]
- func (o *JSValue) ToBool() bool
- func (o *JSValue) ToDate() *foundation.NSDate
- func (o *JSValue) ToDictionary() *foundation.NSDictionary[objc.ID, objc.ID]
- func (o *JSValue) ToDouble() float64
- func (o *JSValue) ToInt32() int32
- func (o *JSValue) ToInt64() int64
- func (o *JSValue) ToNumber() *foundation.NSNumber
- func (o *JSValue) ToObject() objc.ID
- func (o *JSValue) ToObjectOfClass(expectedClass objc.Class) objc.ID
- func (o *JSValue) ToPoint() corefoundation.CGPoint
- func (o *JSValue) ToRange() foundation.NSRange
- func (o *JSValue) ToRect() corefoundation.CGRect
- func (o *JSValue) ToSize() corefoundation.CGSize
- func (o *JSValue) ToString() *foundation.NSString
- func (o *JSValue) ToUInt32() uint32
- func (o *JSValue) ToUInt64() uint64
- func (o *JSValue) ValueAtIndex(index uint) *JSValue
- func (o *JSValue) ValueForProperty(property objc.ID) *JSValue
- type JSVirtualMachine
- type Launch_data_type_t
- type MDLabelDomain
- type MDQueryOptionFlags
- type MDQuerySortOptionFlags
- type Mach_vm_range_flags_t
- type Mach_vm_range_flavor_t
- type Mach_vm_range_tag_t
- type Mpo_flags_t
- type OpaqueJSClass
- type OpaqueJSContext
- type OpaqueJSContextGroup
- type OpaqueJSPropertyNameAccumulator
- type OpaqueJSPropertyNameArray
- type OpaqueJSString
- type OpaqueJSValue
- type Os_clockid_t
- type Ptrauth_key
- type Qos_class_t
- type Virtual_memory_guard_exception_code_t
- type Xpc_listener_create_flags_t
- type Xpc_session_create_flags_t
Constants ¶
const ( KJSClassAttributeNoAutomaticPrototype = 2 KJSClassAttributeNone = 0 )
const ( KJSPropertyAttributeDontDelete = 8 KJSPropertyAttributeDontEnum = 4 KJSPropertyAttributeNone = 0 KJSPropertyAttributeReadOnly = 2 )
Variables ¶
This section is empty.
Functions ¶
func JSBigIntCreateWithDouble ¶
func JSBigIntCreateWithDouble(ctx unsafe.Pointer, value float64, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Creates a JavaScript BigInt with a double. @param ctx The execution context to use. @param value The value to copy into the new BigInt JSValue. @param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception. @result A BigInt JSValue of the value, or NULL if an exception is thrown. @discussion If the value is not an integer, an exception is thrown.
func JSBigIntCreateWithInt64 ¶
func JSBigIntCreateWithInt64(ctx unsafe.Pointer, integer int64, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Creates a JavaScript BigInt with a 64-bit signed integer. @param ctx The execution context to use. @param integer The 64-bit signed integer to copy into the new BigInt JSValue. @param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception. @result A BigInt JSValue of the integer, or NULL if an exception is thrown.
func JSBigIntCreateWithString ¶
func JSBigIntCreateWithString(ctx unsafe.Pointer, string_ unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Creates a JavaScript BigInt with an integer represented in string. @param ctx The execution context to use. @param string The JSStringRef representation of an integer. @param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception. @result A BigInt JSValue of the string, or NULL if an exception is thrown. @discussion This is equivalent to calling the `BigInt` constructor from JavaScript with a string argument.
func JSBigIntCreateWithUInt64 ¶
func JSBigIntCreateWithUInt64(ctx unsafe.Pointer, integer uint64, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Creates a JavaScript BigInt with a 64-bit unsigned integer. @param ctx The execution context to use. @param integer The 64-bit unsigned integer to copy into the new BigInt JSValue. @param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception. @result A BigInt JSValue of the integer, or NULL if an exception is thrown.
func JSCheckScriptSyntax ¶
func JSCheckScriptSyntax(ctx unsafe.Pointer, script unsafe.Pointer, sourceURL unsafe.Pointer, startingLineNumber int, exception unsafe.Pointer) bool
@function JSCheckScriptSyntax @abstract Checks for syntax errors in a string of JavaScript. @param ctx The execution context to use. @param script A JSString containing the script to check for syntax errors. @param sourceURL A JSString containing a URL for the script's source file. This is only used when reporting exceptions. Pass NULL if you do not care to include source file information in exceptions. @param startingLineNumber An integer value specifying the script's starting line number in the file located at sourceURL. This is only used when reporting exceptions. The value is one-based, so the first line is line 1 and invalid values are clamped to 1. @param exception A pointer to a JSValueRef in which to store a syntax error exception, if any. Pass NULL if you do not care to store a syntax error exception. @result true if the script is syntactically correct, otherwise false.
func JSClassCreate ¶
func JSClassCreate(definition *JSClassDefinition) unsafe.Pointer
@function @abstract Creates a JavaScript class suitable for use with JSObjectMake. @param definition A JSClassDefinition that defines the class. @result A JSClass with the given definition. Ownership follows the Create Rule.
func JSClassRelease ¶
@function @abstract Releases a JavaScript class. @param jsClass The JSClass to release.
func JSClassRetain ¶
@function @abstract Retains a JavaScript class. @param jsClass The JSClass to retain. @result A JSClass that is the same as jsClass.
func JSContextCurrentArguments ¶
func JSContextCurrentArguments() *foundation.NSArray[objc.ID]
Returns the arguments to the current native callback from JavaScript code.
func JSContextGetGlobalContext ¶
@function @abstract Gets the global context of a JavaScript execution context. @param ctx The JSContext whose global context you want to get. @result ctx's global context.
func JSContextGetGlobalObject ¶
@function @abstract Gets the global object of a JavaScript execution context. @param ctx The JSContext whose global object you want to get. @result ctx's global object.
func JSContextGetGroup ¶
@function @abstract Gets the context group to which a JavaScript execution context belongs. @param ctx The JSContext whose group you want to get. @result ctx's group.
func JSContextGroupCreate ¶
@function @abstract Creates a JavaScript context group. @discussion A JSContextGroup associates JavaScript contexts with one another. Contexts in the same group may share and exchange JavaScript objects. Sharing and/or exchanging JavaScript objects between contexts in different groups will produce undefined behavior. When objects from the same context group are used in multiple threads, explicit synchronization is required. A JSContextGroup may need to run deferred tasks on a run loop, such as garbage collection or resolving WebAssembly compilations. By default, calling JSContextGroupCreate will use the run loop of the thread it was called on. Currently, there is no API to change a JSContextGroup's run loop once it has been created. @result The created JSContextGroup.
func JSContextGroupRelease ¶
@function @abstract Releases a JavaScript context group. @param group The JSContextGroup to release.
func JSContextGroupRetain ¶
@function @abstract Retains a JavaScript context group. @param group The JSContextGroup to retain. @result A JSContextGroup that is the same as group.
func JSEvaluateScript ¶
func JSEvaluateScript(ctx unsafe.Pointer, script unsafe.Pointer, thisObject unsafe.Pointer, sourceURL unsafe.Pointer, startingLineNumber int, exception unsafe.Pointer) unsafe.Pointer
@function JSEvaluateScript @abstract Evaluates a string of JavaScript. @param ctx The execution context to use. @param script A JSString containing the script to evaluate. @param thisObject The object to use as "this," or NULL to use the global object as "this." @param sourceURL A JSString containing a URL for the script's source file. This is used by debuggers and when reporting exceptions. Pass NULL if you do not care to include source file information. @param startingLineNumber An integer value specifying the script's starting line number in the file located at sourceURL. This is only used when reporting exceptions. The value is one-based, so the first line is line 1 and invalid values are clamped to 1. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result The JSValue that results from evaluating script, or NULL if an exception is thrown.
func JSGarbageCollect ¶
@function JSGarbageCollect @abstract Performs a JavaScript garbage collection. @param ctx The execution context to use. @discussion JavaScript values that are on the machine stack, in a register, protected by JSValueProtect, set as the global object of an execution context, or reachable from any such value will not be collected. During JavaScript execution, you are not required to call this function; the JavaScript engine will garbage collect as needed. JavaScript values created within a context group are automatically destroyed when the last reference to the context group is released.
func JSGlobalContextCopyName ¶
@function @abstract Gets a copy of the name of a context. @param ctx The JSGlobalContext whose name you want to get. @result The name for ctx. @discussion A JSGlobalContext's name is exposed when inspecting the context to make it easier to identify the context you would like to inspect.
func JSGlobalContextCreate ¶
@function @abstract Creates a global JavaScript execution context. @discussion JSGlobalContextCreate allocates a global object and populates it with all the built-in JavaScript objects, such as Object, Function, String, and Array. In WebKit version 4.0 and later, the context is created in a unique context group. Therefore, scripts may execute in it concurrently with scripts executing in other contexts. However, you may not use values created in the context in other contexts. @param globalObjectClass The class to use when creating the global object. Pass NULL to use the default object class. @result A JSGlobalContext with a global object of class globalObjectClass.
func JSGlobalContextCreateInGroup ¶
func JSGlobalContextCreateInGroup(group unsafe.Pointer, globalObjectClass unsafe.Pointer) unsafe.Pointer
@function @abstract Creates a global JavaScript execution context in the context group provided. @discussion JSGlobalContextCreateInGroup allocates a global object and populates it with all the built-in JavaScript objects, such as Object, Function, String, and Array. @param globalObjectClass The class to use when creating the global object. Pass NULL to use the default object class. @param group The context group to use. The created global context retains the group. Pass NULL to create a unique group for the context. @result A JSGlobalContext with a global object of class globalObjectClass and a context group equal to group.
func JSGlobalContextIsInspectable ¶
@function @abstract Gets whether the context is inspectable in Web Inspector. @param ctx The JSGlobalContext that you want to change the inspectability of. @result Whether the context is inspectable in Web Inspector.
func JSGlobalContextRelease ¶
@function @abstract Releases a global JavaScript execution context. @param ctx The JSGlobalContext to release.
func JSGlobalContextRetain ¶
@function @abstract Retains a global JavaScript execution context. @param ctx The JSGlobalContext to retain. @result A JSGlobalContext that is the same as ctx.
func JSGlobalContextSetInspectable ¶
@function @abstract Sets whether the context is inspectable in Web Inspector. Default value is NO. @param ctx The JSGlobalContext that you want to change the inspectability of. @param inspectable YES to allow Web Inspector to connect to the context, otherwise NO.
func JSGlobalContextSetName ¶
@function @abstract Sets the name exposed when inspecting a context. @param ctx The JSGlobalContext that you want to name. @param name The name to set on the context.
func JSObjectCallAsConstructor ¶
func JSObjectCallAsConstructor(ctx unsafe.Pointer, object unsafe.Pointer, argumentCount uint, arguments unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Calls an object as a constructor. @param ctx The execution context to use. @param object The JSObject to call as a constructor. @param argumentCount An integer count of the number of arguments in arguments. @param arguments A JSValue array of arguments to pass to the constructor. Pass NULL if argumentCount is 0. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result The JSObject that results from calling object as a constructor, or NULL if an exception is thrown or object is not a constructor.
func JSObjectCallAsFunction ¶
func JSObjectCallAsFunction(ctx unsafe.Pointer, object unsafe.Pointer, thisObject unsafe.Pointer, argumentCount uint, arguments unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Calls an object as a function. @param ctx The execution context to use. @param object The JSObject to call as a function. @param thisObject The object to use as "this," or NULL to use the global object as "this." @param argumentCount An integer count of the number of arguments in arguments. @param arguments A JSValue array of arguments to pass to the function. Pass NULL if argumentCount is 0. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result The JSValue that results from calling object as a function, or NULL if an exception is thrown or object is not a function.
func JSObjectCopyPropertyNames ¶
@function @abstract Gets the names of an object's enumerable properties. @param ctx The execution context to use. @param object The object whose property names you want to get. @result A JSPropertyNameArray containing the names object's enumerable properties. Ownership follows the Create Rule.
func JSObjectDeleteProperty ¶
func JSObjectDeleteProperty(ctx unsafe.Pointer, object unsafe.Pointer, propertyName unsafe.Pointer, exception unsafe.Pointer) bool
@function @abstract Deletes a property from an object. @param ctx The execution context to use. @param object The JSObject whose property you want to delete. @param propertyName A JSString containing the property's name. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result true if the delete operation succeeds, otherwise false (for example, if the property has the kJSPropertyAttributeDontDelete attribute set).
func JSObjectDeletePropertyForKey ¶
func JSObjectDeletePropertyForKey(ctx unsafe.Pointer, object unsafe.Pointer, propertyKey unsafe.Pointer, exception unsafe.Pointer) bool
@function @abstract Deletes a property from an object using a JSValueRef as the property key. @param ctx The execution context to use. @param object The JSObject whose property you want to delete. @param propertyKey A JSValueRef containing the property key to use when looking up the property. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result true if the delete operation succeeds, otherwise false (for example, if the property has the kJSPropertyAttributeDontDelete attribute set). @discussion This function is the same as performing "delete object[propertyKey]" from JavaScript.
func JSObjectGetArrayBufferByteLength ¶
func JSObjectGetArrayBufferByteLength(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) uint
@function @abstract Returns the number of bytes in a JavaScript data object. @param ctx The execution context to use. @param object The JS Arary Buffer object whose length in bytes to return. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result The number of bytes stored in the data object.
func JSObjectGetArrayBufferBytesPtr ¶
func JSObjectGetArrayBufferBytesPtr(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Returns a pointer to the data buffer that serves as the backing store for a JavaScript Typed Array object. @param object The Array Buffer object whose internal backing store pointer to return. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result A pointer to the raw data buffer that serves as object's backing store or NULL if object is not an Array Buffer object. @discussion The pointer returned by this function is temporary and is not guaranteed to remain valid across JavaScriptCore API calls.
func JSObjectGetPrivate ¶
@function @abstract Gets an object's private data. @param object A JSObject whose private data you want to get. @result A void* that is the object's private data, if the object has private data, otherwise NULL.
func JSObjectGetProperty ¶
func JSObjectGetProperty(ctx unsafe.Pointer, object unsafe.Pointer, propertyName unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Gets a property from an object. @param ctx The execution context to use. @param object The JSObject whose property you want to get. @param propertyName A JSString containing the property's name. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result The property's value if object has the property, otherwise the undefined value.
func JSObjectGetPropertyAtIndex ¶
func JSObjectGetPropertyAtIndex(ctx unsafe.Pointer, object unsafe.Pointer, propertyIndex uint, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Gets a property from an object by numeric index. @param ctx The execution context to use. @param object The JSObject whose property you want to get. @param propertyIndex An integer value that is the property's name. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result The property's value if object has the property, otherwise the undefined value. @discussion Calling JSObjectGetPropertyAtIndex is equivalent to calling JSObjectGetProperty with a string containing propertyIndex, but JSObjectGetPropertyAtIndex provides optimized access to numeric properties.
func JSObjectGetPropertyForKey ¶
func JSObjectGetPropertyForKey(ctx unsafe.Pointer, object unsafe.Pointer, propertyKey unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Gets a property from an object using a JSValueRef as the property key. @param ctx The execution context to use. @param object The JSObject whose property you want to get. @param propertyKey A JSValueRef containing the property key to use when looking up the property. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result The property's value if object has the property key, otherwise the undefined value. @discussion This function is the same as performing "object[propertyKey]" from JavaScript.
func JSObjectGetPrototype ¶
@function @abstract Gets an object's prototype. @param ctx The execution context to use. @param object A JSObject whose prototype you want to get. @result A JSValue that is the object's prototype.
func JSObjectGetTypedArrayBuffer ¶
func JSObjectGetTypedArrayBuffer(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Returns the JavaScript Array Buffer object that is used as the backing of a JavaScript Typed Array object. @param ctx The execution context to use. @param object The JSObjectRef whose Typed Array type data pointer to obtain. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result A JSObjectRef with a JSTypedArrayType of kJSTypedArrayTypeArrayBuffer or NULL if object is not a Typed Array.
func JSObjectGetTypedArrayByteLength ¶
func JSObjectGetTypedArrayByteLength(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) uint
@function @abstract Returns the byte length of a JavaScript Typed Array object. @param ctx The execution context to use. @param object The Typed Array object whose byte length to return. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result The byte length of the Typed Array object or 0 if the object is not a Typed Array object.
func JSObjectGetTypedArrayByteOffset ¶
func JSObjectGetTypedArrayByteOffset(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) uint
@function @abstract Returns the byte offset of a JavaScript Typed Array object. @param ctx The execution context to use. @param object The Typed Array object whose byte offset to return. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result The byte offset of the Typed Array object or 0 if the object is not a Typed Array object.
func JSObjectGetTypedArrayBytesPtr ¶
func JSObjectGetTypedArrayBytesPtr(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Returns a temporary pointer to the backing store of a JavaScript Typed Array object. @param ctx The execution context to use. @param object The Typed Array object whose backing store pointer to return. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result A pointer to the raw data buffer that serves as object's backing store or NULL if object is not a Typed Array object. @discussion The pointer returned by this function is temporary and is not guaranteed to remain valid across JavaScriptCore API calls.
func JSObjectGetTypedArrayLength ¶
func JSObjectGetTypedArrayLength(ctx unsafe.Pointer, object unsafe.Pointer, exception unsafe.Pointer) uint
@function @abstract Returns the length of a JavaScript Typed Array object. @param ctx The execution context to use. @param object The Typed Array object whose length to return. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result The length of the Typed Array object or 0 if the object is not a Typed Array object.
func JSObjectHasProperty ¶
func JSObjectHasProperty(ctx unsafe.Pointer, object unsafe.Pointer, propertyName unsafe.Pointer) bool
@function @abstract Tests whether an object has a given property. @param object The JSObject to test. @param propertyName A JSString containing the property's name. @result true if the object has a property whose name matches propertyName, otherwise false.
func JSObjectHasPropertyForKey ¶
func JSObjectHasPropertyForKey(ctx unsafe.Pointer, object unsafe.Pointer, propertyKey unsafe.Pointer, exception unsafe.Pointer) bool
@function @abstract Tests whether an object has a given property using a JSValueRef as the property key. @param object The JSObject to test. @param propertyKey A JSValueRef containing the property key to use when looking up the property. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result true if the object has a property whose name matches propertyKey, otherwise false. @discussion This function is the same as performing "propertyKey in object" from JavaScript.
func JSObjectIsConstructor ¶
@function @abstract Tests whether an object can be called as a constructor. @param ctx The execution context to use. @param object The JSObject to test. @result true if the object can be called as a constructor, otherwise false.
func JSObjectIsFunction ¶
@function @abstract Tests whether an object can be called as a function. @param ctx The execution context to use. @param object The JSObject to test. @result true if the object can be called as a function, otherwise false.
func JSObjectMake ¶
@function @abstract Creates a JavaScript object. @param ctx The execution context to use. @param jsClass The JSClass to assign to the object. Pass NULL to use the default object class. @param data A void* to set as the object's private data. Pass NULL to specify no private data. @result A JSObject with the given class and private data. @discussion The default object class does not allocate storage for private data, so you must provide a non-NULL jsClass to JSObjectMake if you want your object to be able to store private data. data is set on the created object before the intialize methods in its class chain are called. This enables the initialize methods to retrieve and manipulate data through JSObjectGetPrivate.
func JSObjectMakeArray ¶
func JSObjectMakeArray(ctx unsafe.Pointer, argumentCount uint, arguments unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Creates a JavaScript Array object. @param ctx The execution context to use. @param argumentCount An integer count of the number of arguments in arguments. @param arguments A JSValue array of data to populate the Array with. Pass NULL if argumentCount is 0. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result A JSObject that is an Array. @discussion The behavior of this function does not exactly match the behavior of the built-in Array constructor. Specifically, if one argument is supplied, this function returns an array with one element.
func JSObjectMakeArrayBufferWithBytesNoCopy ¶
func JSObjectMakeArrayBufferWithBytesNoCopy(ctx unsafe.Pointer, bytes_ unsafe.Pointer, byteLength uint, bytesDeallocator unsafe.Pointer, deallocatorContext unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Creates a JavaScript Array Buffer object from an existing pointer. @param ctx The execution context to use. @param bytes A pointer to the byte buffer to be used as the backing store of the Typed Array object. @param byteLength The number of bytes pointed to by the parameter bytes. @param bytesDeallocator The allocator to use to deallocate the external buffer when the Typed Array data object is deallocated. @param deallocatorContext A pointer to pass back to the deallocator. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result A JSObjectRef Array Buffer whose backing store is the same as the one pointed to by bytes or NULL if there was an error. @discussion If an exception is thrown during this function the bytesDeallocator will always be called.
func JSObjectMakeConstructor ¶
func JSObjectMakeConstructor(ctx unsafe.Pointer, jsClass unsafe.Pointer, callAsConstructor unsafe.Pointer) unsafe.Pointer
@function @abstract Convenience method for creating a JavaScript constructor. @param ctx The execution context to use. @param jsClass A JSClass that is the class your constructor will assign to the objects its constructs. jsClass will be used to set the constructor's .prototype property, and to evaluate 'instanceof' expressions. Pass NULL to use the default object class. @param callAsConstructor A JSObjectCallAsConstructorCallback to invoke when your constructor is used in a 'new' expression. Pass NULL to use the default object constructor. @result A JSObject that is a constructor. The object's prototype will be the default object prototype. @discussion The default object constructor takes no arguments and constructs an object of class jsClass with no private data. If the constructor is inherited via JS subclassing and the value returned from callAsConstructor was created with jsClass, then the returned object will have it's prototype overridden to the derived class's prototype.
func JSObjectMakeDate ¶
func JSObjectMakeDate(ctx unsafe.Pointer, argumentCount uint, arguments unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Creates a JavaScript Date object, as if by invoking the built-in Date constructor. @param ctx The execution context to use. @param argumentCount An integer count of the number of arguments in arguments. @param arguments A JSValue array of arguments to pass to the Date Constructor. Pass NULL if argumentCount is 0. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result A JSObject that is a Date.
func JSObjectMakeDeferredPromise ¶
func JSObjectMakeDeferredPromise(ctx unsafe.Pointer, resolve unsafe.Pointer, reject unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Creates a JavaScript promise object by invoking the provided executor. @param ctx The execution context to use. @param resolve A pointer to a JSObjectRef in which to store the resolve function for the new promise. Pass NULL if you do not care to store the resolve callback. @param reject A pointer to a JSObjectRef in which to store the reject function for the new promise. Pass NULL if you do not care to store the reject callback. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result A JSObject that is a promise or NULL if an exception occurred.
func JSObjectMakeError ¶
func JSObjectMakeError(ctx unsafe.Pointer, argumentCount uint, arguments unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Creates a JavaScript Error object, as if by invoking the built-in Error constructor. @param ctx The execution context to use. @param argumentCount An integer count of the number of arguments in arguments. @param arguments A JSValue array of arguments to pass to the Error Constructor. Pass NULL if argumentCount is 0. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result A JSObject that is an Error.
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
@function @abstract Creates a function with a given script as its body. @param ctx The execution context to use. @param name A JSString containing the function's name. This will be used when converting the function to string. Pass NULL to create an anonymous function. @param parameterCount An integer count of the number of parameter names in parameterNames. @param parameterNames A JSString array containing the names of the function's parameters. Pass NULL if parameterCount is 0. @param body A JSString containing the script to use as the function's body. @param sourceURL A JSString containing a URL for the script's source file. This is only used when reporting exceptions. Pass NULL if you do not care to include source file information in exceptions. @param startingLineNumber An integer value specifying the script's starting line number in the file located at sourceURL. This is only used when reporting exceptions. The value is one-based, so the first line is line 1 and invalid values are clamped to 1. @param exception A pointer to a JSValueRef in which to store a syntax error exception, if any. Pass NULL if you do not care to store a syntax error exception. @result A JSObject that is a function, or NULL if either body or parameterNames contains a syntax error. The object's prototype will be the default function prototype. @discussion Use this method when you want to execute a script repeatedly, to avoid the cost of re-parsing the script before each execution.
func JSObjectMakeFunctionWithCallback ¶
func JSObjectMakeFunctionWithCallback(ctx unsafe.Pointer, name unsafe.Pointer, callAsFunction unsafe.Pointer) unsafe.Pointer
@function @abstract Convenience method for creating a JavaScript function with a given callback as its implementation. @param ctx The execution context to use. @param name A JSString containing the function's name. This will be used when converting the function to string. Pass NULL to create an anonymous function. @param callAsFunction The JSObjectCallAsFunctionCallback to invoke when the function is called. @result A JSObject that is a function. The object's prototype will be the default function prototype.
func JSObjectMakeRegExp ¶
func JSObjectMakeRegExp(ctx unsafe.Pointer, argumentCount uint, arguments unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Creates a JavaScript RegExp object, as if by invoking the built-in RegExp constructor. @param ctx The execution context to use. @param argumentCount An integer count of the number of arguments in arguments. @param arguments A JSValue array of arguments to pass to the RegExp Constructor. Pass NULL if argumentCount is 0. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result A JSObject that is a RegExp.
func JSObjectMakeTypedArray ¶
func JSObjectMakeTypedArray(ctx unsafe.Pointer, arrayType JSTypedArrayType, length uint, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Creates a JavaScript Typed Array object with the given number of elements. @param ctx The execution context to use. @param arrayType A value identifying the type of array to create. If arrayType is kJSTypedArrayTypeNone or kJSTypedArrayTypeArrayBuffer then NULL will be returned. @param length The number of elements to be in the new Typed Array. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result A JSObjectRef that is a Typed Array with all elements set to zero or NULL if there was an error.
func JSObjectMakeTypedArrayWithArrayBuffer ¶
func JSObjectMakeTypedArrayWithArrayBuffer(ctx unsafe.Pointer, arrayType JSTypedArrayType, buffer unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Creates a JavaScript Typed Array object from an existing JavaScript Array Buffer object. @param ctx The execution context to use. @param arrayType A value identifying the type of array to create. If arrayType is kJSTypedArrayTypeNone or kJSTypedArrayTypeArrayBuffer then NULL will be returned. @param buffer An Array Buffer object that should be used as the backing store for the created JavaScript Typed Array object. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result A JSObjectRef that is a Typed Array or NULL if there was an error. The backing store of the Typed Array will be buffer.
func JSObjectMakeTypedArrayWithArrayBufferAndOffset ¶
func JSObjectMakeTypedArrayWithArrayBufferAndOffset(ctx unsafe.Pointer, arrayType JSTypedArrayType, buffer unsafe.Pointer, byteOffset uint, length uint, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Creates a JavaScript Typed Array object from an existing JavaScript Array Buffer object with the given offset and length. @param ctx The execution context to use. @param arrayType A value identifying the type of array to create. If arrayType is kJSTypedArrayTypeNone or kJSTypedArrayTypeArrayBuffer then NULL will be returned. @param buffer An Array Buffer object that should be used as the backing store for the created JavaScript Typed Array object. @param byteOffset The byte offset for the created Typed Array. byteOffset should aligned with the element size of arrayType. @param length The number of elements to include in the Typed Array. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result A JSObjectRef that is a Typed Array or NULL if there was an error. The backing store of the Typed Array will be buffer.
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
@function @abstract Creates a JavaScript Typed Array object from an existing pointer. @param ctx The execution context to use. @param arrayType A value identifying the type of array to create. If arrayType is kJSTypedArrayTypeNone or kJSTypedArrayTypeArrayBuffer then NULL will be returned. @param bytes A pointer to the byte buffer to be used as the backing store of the Typed Array object. @param byteLength The number of bytes pointed to by the parameter bytes. @param bytesDeallocator The allocator to use to deallocate the external buffer when the JSTypedArrayData object is deallocated. @param deallocatorContext A pointer to pass back to the deallocator. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @result A JSObjectRef Typed Array whose backing store is the same as the one pointed to by bytes or NULL if there was an error. @discussion If an exception is thrown during this function the bytesDeallocator will always be called.
func JSObjectSetPrivate ¶
@function @abstract Sets a pointer to private data on an object. @param object The JSObject whose private data you want to set. @param data A void* to set as the object's private data. @result true if object can store private data, otherwise false. @discussion The default object class does not allocate storage for private data. Only objects created with a non-NULL JSClass can store private data.
func JSObjectSetProperty ¶
func JSObjectSetProperty(ctx unsafe.Pointer, object unsafe.Pointer, propertyName unsafe.Pointer, value unsafe.Pointer, attributes uint, exception unsafe.Pointer)
@function @abstract Sets a property on an object. @param ctx The execution context to use. @param object The JSObject whose property you want to set. @param propertyName A JSString containing the property's name. @param value A JSValueRef to use as the property's value. @param attributes A logically ORed set of JSPropertyAttributes to give to the property. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception.
func JSObjectSetPropertyAtIndex ¶
func JSObjectSetPropertyAtIndex(ctx unsafe.Pointer, object unsafe.Pointer, propertyIndex uint, value unsafe.Pointer, exception unsafe.Pointer)
@function @abstract Sets a property on an object by numeric index. @param ctx The execution context to use. @param object The JSObject whose property you want to set. @param propertyIndex The property's name as a number. @param value A JSValue to use as the property's value. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @discussion Calling JSObjectSetPropertyAtIndex is equivalent to calling JSObjectSetProperty with a string containing propertyIndex, but JSObjectSetPropertyAtIndex provides optimized access to numeric properties.
func JSObjectSetPropertyForKey ¶
func JSObjectSetPropertyForKey(ctx unsafe.Pointer, object unsafe.Pointer, propertyKey unsafe.Pointer, value unsafe.Pointer, attributes uint, exception unsafe.Pointer)
@function @abstract Sets a property on an object using a JSValueRef as the property key. @param ctx The execution context to use. @param object The JSObject whose property you want to set. @param propertyKey A JSValueRef containing the property key to use when looking up the property. @param value A JSValueRef to use as the property's value. @param attributes A logically ORed set of JSPropertyAttributes to give to the property. @param exception A pointer to a JSValueRef in which to store an exception, if any. Pass NULL if you do not care to store an exception. @discussion This function is the same as performing "object[propertyKey] = value" from JavaScript.
func JSObjectSetPrototype ¶
@function @abstract Sets an object's prototype. @param ctx The execution context to use. @param object The JSObject whose prototype you want to set. @param value A JSValue to set as the object's prototype.
func JSPropertyDescriptorConfigurableKey ¶
func JSPropertyDescriptorConfigurableKey() *foundation.NSString
@const
func JSPropertyDescriptorEnumerableKey ¶
func JSPropertyDescriptorEnumerableKey() *foundation.NSString
@const
func JSPropertyDescriptorWritableKey ¶
func JSPropertyDescriptorWritableKey() *foundation.NSString
@group Property Descriptor Constants @discussion These keys may assist in creating a property descriptor for use with the defineProperty method on JSValue. Property descriptors must fit one of three descriptions: Data Descriptor: - A descriptor containing one or both of the keys <code>value</code> and <code>writable</code>, and optionally containing one or both of the keys <code>enumerable</code> and <code>configurable</code>. A data descriptor may not contain either the <code>get</code> or <code>set</code> key. A data descriptor may be used to create or modify the attributes of a data property on an object (replacing any existing accessor property). Accessor Descriptor: - A descriptor containing one or both of the keys <code>get</code> and <code>set</code>, and optionally containing one or both of the keys <code>enumerable</code> and <code>configurable</code>. An accessor descriptor may not contain either the <code>value</code> or <code>writable</code> key. An accessor descriptor may be used to create or modify the attributes of an accessor property on an object (replacing any existing data property). Generic Descriptor: - A descriptor containing one or both of the keys <code>enumerable</code> and <code>configurable</code>. A generic descriptor may not contain any of the keys <code>value</code>, <code>writable</code>, <code>get</code>, or <code>set</code>. A generic descriptor may be used to modify the attributes of an existing data or accessor property, or to create a new data property. @const
func JSPropertyNameAccumulatorAddName ¶
@function @abstract Adds a property name to a JavaScript property name accumulator. @param accumulator The accumulator object to which to add the property name. @param propertyName The property name to add.
func JSPropertyNameArrayGetCount ¶
@function @abstract Gets a count of the number of items in a JavaScript property name array. @param array The array from which to retrieve the count. @result An integer count of the number of names in array.
func JSPropertyNameArrayGetNameAtIndex ¶
@function @abstract Gets a property name at a given index in a JavaScript property name array. @param array The array from which to retrieve the property name. @param index The index of the property name to retrieve. @result A JSStringRef containing the property name.
func JSPropertyNameArrayRelease ¶
@function @abstract Releases a JavaScript property name array. @param array The JSPropetyNameArray to release.
func JSPropertyNameArrayRetain ¶
@function @abstract Retains a JavaScript property name array. @param array The JSPropertyNameArray to retain. @result A JSPropertyNameArray that is the same as array.
func JSStringCopyCFString ¶
@function @abstract Creates a CFString from a JavaScript string. @param alloc The alloc parameter to pass to CFStringCreate. @param string The JSString to copy into the new CFString. @result A CFString containing string. Ownership follows the Create Rule.
func JSStringCreateWithCFString ¶
@function @abstract Creates a JavaScript string from a CFString. @discussion This function is optimized to take advantage of cases when CFStringGetCharactersPtr returns a valid pointer. @param string The CFString to copy into the new JSString. @result A JSString containing string. Ownership follows the Create Rule.
func JSStringCreateWithCharacters ¶
@function @abstract Creates a JavaScript string from a buffer of Unicode characters. @param chars The buffer of Unicode characters to copy into the new JSString. @param numChars The number of characters to copy from the buffer pointed to by chars. @result A JSString containing chars. Ownership follows the Create Rule.
func JSStringCreateWithUTF8CString ¶
@function @abstract Creates a JavaScript string from a null-terminated UTF8 string. @param string The null-terminated UTF8 string to copy into the new JSString. @result A JSString containing string. Ownership follows the Create Rule.
func JSStringGetCharactersPtr ¶
@function @abstract Returns a pointer to the Unicode character buffer that serves as the backing store for a JavaScript string. @param string The JSString whose backing store you want to access. @result A pointer to the Unicode character buffer that serves as string's backing store, which will be deallocated when string is deallocated.
func JSStringGetLength ¶
@function @abstract Returns the number of Unicode characters in a JavaScript string. @param string The JSString whose length (in Unicode characters) you want to know. @result The number of Unicode characters stored in string.
func JSStringGetMaximumUTF8CStringSize ¶
@function @abstract Returns the maximum number of bytes a JavaScript string will take up if converted into a null-terminated UTF8 string. @param string The JSString whose maximum converted size (in bytes) you want to know. @result The maximum number of bytes that could be required to convert string into a null-terminated UTF8 string. The number of bytes that the conversion actually ends up requiring could be less than this, but never more.
func JSStringGetUTF8CString ¶
@function @abstract Converts a JavaScript string into a null-terminated UTF8 string, and copies the result into an external byte buffer. @param string The source JSString. @param buffer The destination byte buffer into which to copy a null-terminated UTF8 representation of string. On return, buffer contains a UTF8 string representation of string. If bufferSize is too small, buffer will contain only partial results. If buffer is not at least bufferSize bytes in size, behavior is undefined. @param bufferSize The size of the external buffer in bytes. @result The number of bytes written into buffer (including the null-terminator byte).
func JSStringIsEqual ¶
@function @abstract Tests whether two JavaScript strings match. @param a The first JSString to test. @param b The second JSString to test. @result true if the two strings match, otherwise false.
func JSStringIsEqualToUTF8CString ¶
@function @abstract Tests whether a JavaScript string matches a null-terminated UTF8 string. @param a The JSString to test. @param b The null-terminated UTF8 string to test. @result true if the two strings match, otherwise false.
func JSStringRelease ¶
@function @abstract Releases a JavaScript string. @param string The JSString to release.
func JSStringRetain ¶
@function @abstract Retains a JavaScript string. @param string The JSString to retain. @result A JSString that is the same as string.
func JSValueCreateJSONString ¶
func JSValueCreateJSONString(ctx unsafe.Pointer, value unsafe.Pointer, indent uint, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Creates a JavaScript string containing the JSON serialized representation of a JS value. @param ctx The execution context to use. @param value The value to serialize. @param indent The number of spaces to indent when nesting. If 0, the resulting JSON will not contains newlines. The size of the indent is clamped to 10 spaces. @param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception. @result A JSString with the result of serialization, or NULL if an exception is thrown.
func JSValueIsArray ¶
@function @abstract Tests whether a JavaScript value is an array. @param ctx The execution context to use. @param value The JSValue to test. @result true if value is an array, otherwise false.
func JSValueIsBigInt ¶
@function @abstract Tests whether a JavaScript value's type is the BigInt type. @param ctx The execution context to use. @param value The JSValue to test. @result true if value's type is the BigInt type, otherwise false.
func JSValueIsBoolean ¶
@function @abstract Tests whether a JavaScript value's type is the boolean type. @param ctx The execution context to use. @param value The JSValue to test. @result true if value's type is the boolean type, otherwise false.
func JSValueIsDate ¶
@function @abstract Tests whether a JavaScript value is a date. @param ctx The execution context to use. @param value The JSValue to test. @result true if value is a date, otherwise false.
func JSValueIsEqual ¶
func JSValueIsEqual(ctx unsafe.Pointer, a unsafe.Pointer, b unsafe.Pointer, exception unsafe.Pointer) bool
@function @abstract Tests whether two JavaScript values are equal, as compared by the JS == operator. @param ctx The execution context to use. @param a The first value to test. @param b The second value to test. @param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception. @result true if the two values are equal, false if they are not equal or an exception is thrown.
func JSValueIsInstanceOfConstructor ¶
func JSValueIsInstanceOfConstructor(ctx unsafe.Pointer, value unsafe.Pointer, constructor unsafe.Pointer, exception unsafe.Pointer) bool
@function @abstract Tests whether a JavaScript value is an object constructed by a given constructor, as compared by the JS instanceof operator. @param ctx The execution context to use. @param value The JSValue to test. @param constructor The constructor to test against. @param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception. @result true if value is an object constructed by constructor, as compared by the JS instanceof operator, otherwise false.
func JSValueIsNull ¶
@function @abstract Tests whether a JavaScript value's type is the null type. @param ctx The execution context to use. @param value The JSValue to test. @result true if value's type is the null type, otherwise false.
func JSValueIsNumber ¶
@function @abstract Tests whether a JavaScript value's type is the number type. @param ctx The execution context to use. @param value The JSValue to test. @result true if value's type is the number type, otherwise false.
func JSValueIsObject ¶
@function @abstract Tests whether a JavaScript value's type is the object type. @param ctx The execution context to use. @param value The JSValue to test. @result true if value's type is the object type, otherwise false.
func JSValueIsObjectOfClass ¶
@function @abstract Tests whether a JavaScript value is an object with a given class in its class chain. @param ctx The execution context to use. @param value The JSValue to test. @param jsClass The JSClass to test against. @result true if value is an object and has jsClass in its class chain, otherwise false.
func JSValueIsStrictEqual ¶
@function @abstract Tests whether two JavaScript values are strict equal, as compared by the JS === operator. @param ctx The execution context to use. @param a The first value to test. @param b The second value to test. @result true if the two values are strict equal, otherwise false.
func JSValueIsString ¶
@function @abstract Tests whether a JavaScript value's type is the string type. @param ctx The execution context to use. @param value The JSValue to test. @result true if value's type is the string type, otherwise false.
func JSValueIsSymbol ¶
@function @abstract Tests whether a JavaScript value's type is the symbol type. @param ctx The execution context to use. @param value The JSValue to test. @result true if value's type is the symbol type, otherwise false.
func JSValueIsUndefined ¶
@function @abstract Tests whether a JavaScript value's type is the undefined type. @param ctx The execution context to use. @param value The JSValue to test. @result true if value's type is the undefined type, otherwise false.
func JSValueMakeBoolean ¶
@function @abstract Creates a JavaScript value of the boolean type. @param ctx The execution context to use. @param boolean The bool to assign to the newly created JSValue. @result A JSValue of the boolean type, representing the value of boolean.
func JSValueMakeFromJSONString ¶
@function @abstract Creates a JavaScript value from a JSON formatted string. @param ctx The execution context to use. @param string The JSString containing the JSON string to be parsed. @result A JSValue containing the parsed value, or NULL if the input is invalid.
func JSValueMakeNull ¶
@function @abstract Creates a JavaScript value of the null type. @param ctx The execution context to use. @result The unique null value.
func JSValueMakeNumber ¶
@function @abstract Creates a JavaScript value of the number type. @param ctx The execution context to use. @param number The double to assign to the newly created JSValue. @result A JSValue of the number type, representing the value of number.
func JSValueMakeString ¶
@function @abstract Creates a JavaScript value of the string type. @param ctx The execution context to use. @param string The JSString to assign to the newly created JSValue. The newly created JSValue retains string, and releases it upon garbage collection. @result A JSValue of the string type, representing the value of string.
func JSValueMakeSymbol ¶
@function @abstract Creates a JavaScript value of the symbol type. @param ctx The execution context to use. @param description A description of the newly created symbol value. @result A unique JSValue of the symbol type, whose description matches the one provided.
func JSValueMakeUndefined ¶
@function @abstract Creates a JavaScript value of the undefined type. @param ctx The execution context to use. @result The unique undefined value.
func JSValueProtect ¶
@function @abstract Protects a JavaScript value from garbage collection. @param ctx The execution context to use. @param value The JSValue to protect. @discussion Use this method when you want to store a JSValue in a global or on the heap, where the garbage collector will not be able to discover your reference to it. A value may be protected multiple times and must be unprotected an equal number of times before becoming eligible for garbage collection.
func JSValueToBoolean ¶
@function @abstract Converts a JavaScript value to boolean and returns the resulting boolean. @param ctx The execution context to use. @param value The JSValue to convert. @result The boolean result of conversion.
func JSValueToInt32 ¶
@function @abstract Converts a JSValue to a singed 32-bit integer and returns the resulting integer. @param ctx The execution context to use. @param value The JSValue to convert. @param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception. @result An int32_t with the result of conversion, or 0 if an exception is thrown. Since 0 is valid value, `exception` must be checked after the call. @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 JSValue is truncated to an int32_t.
func JSValueToInt64 ¶
@function @abstract Converts a JSValue to a singed 64-bit integer and returns the resulting integer. @param ctx The execution context to use. @param value The JSValue to convert. @param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception. @result An int64_t with the result of conversion, or 0 if an exception is thrown. Since 0 is valid value, `exception` must be checked after the call. @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 JSValue is truncated to an int64_t.
func JSValueToNumber ¶
@function @abstract Converts a JavaScript value to number and returns the resulting number. @param ctx The execution context to use. @param value The JSValue to convert. @param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception. @result The numeric result of conversion, or NaN if an exception is thrown. @discussion The result is equivalent to `Number(value)` in JavaScript.
func JSValueToObject ¶
func JSValueToObject(ctx unsafe.Pointer, value unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Converts a JavaScript value to object and returns the resulting object. @param ctx The execution context to use. @param value The JSValue to convert. @param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception. @result The JSObject result of conversion, or NULL if an exception is thrown.
func JSValueToStringCopy ¶
func JSValueToStringCopy(ctx unsafe.Pointer, value unsafe.Pointer, exception unsafe.Pointer) unsafe.Pointer
@function @abstract Converts a JavaScript value to string and copies the result into a JavaScript string. @param ctx The execution context to use. @param value The JSValue to convert. @param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception. @result A JSString with the result of conversion, or NULL if an exception is thrown. Ownership follows the Create Rule.
func JSValueToUInt32 ¶
@function @abstract Converts a JSValue to an unsigned 32-bit integer and returns the resulting integer. @param ctx The execution context to use. @param value The JSValue to convert. @param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception. @result A uint32_t with the result of conversion, or 0 if an exception is thrown. Since 0 is valid value, `exception` must be checked after the call. @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 JSValue is truncated to a uint32_t.
func JSValueToUInt64 ¶
@function @abstract Converts a JSValue to an unsigned 64-bit integer and returns the resulting integer. @param ctx The execution context to use. @param value The JSValue to convert. @param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception. @result A uint64_t with the result of conversion, or 0 if an exception is thrown. Since 0 is valid value, `exception` must be checked after the call. @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 JSValue is truncated to a uint64_t.
func JSValueUnprotect ¶
@function @abstract Unprotects a JavaScript value from garbage collection. @param ctx The execution context to use. @param value The JSValue to unprotect. @discussion A value may be protected multiple times and must be unprotected an equal number of times before becoming eligible for garbage collection.
func SymbolAvailable ¶
SymbolAvailable reports whether the named C symbol was bound when the library loaded. Calling a generated wrapper whose symbol is unavailable dereferences a nil function variable and panics.
Types ¶
type Acl_entry_id_t ¶
type Acl_entry_id_t int32
const ( ACL_FIRST_ENTRY Acl_entry_id_t = 0 ACL_NEXT_ENTRY Acl_entry_id_t = -1 ACL_LAST_ENTRY Acl_entry_id_t = -2 )
func (Acl_entry_id_t) String ¶
func (e Acl_entry_id_t) String() string
type Acl_flag_t ¶
type Acl_flag_t int32
const ( ACL_FLAG_DEFER_INHERIT Acl_flag_t = 1 ACL_FLAG_NO_INHERIT Acl_flag_t = 131072 ACL_ENTRY_INHERITED Acl_flag_t = 16 ACL_ENTRY_FILE_INHERIT Acl_flag_t = 32 ACL_ENTRY_DIRECTORY_INHERIT Acl_flag_t = 64 ACL_ENTRY_LIMIT_INHERIT Acl_flag_t = 128 ACL_ENTRY_ONLY_INHERIT Acl_flag_t = 256 )
func (Acl_flag_t) String ¶
func (e Acl_flag_t) String() string
type Acl_perm_t ¶
type Acl_perm_t int32
const ( ACL_READ_DATA Acl_perm_t = 2 ACL_LIST_DIRECTORY Acl_perm_t = 2 ACL_WRITE_DATA Acl_perm_t = 4 ACL_ADD_FILE Acl_perm_t = 4 ACL_EXECUTE Acl_perm_t = 8 ACL_SEARCH Acl_perm_t = 8 ACL_DELETE Acl_perm_t = 16 ACL_APPEND_DATA Acl_perm_t = 32 ACL_ADD_SUBDIRECTORY Acl_perm_t = 32 ACL_DELETE_CHILD Acl_perm_t = 64 ACL_READ_ATTRIBUTES Acl_perm_t = 128 ACL_WRITE_ATTRIBUTES Acl_perm_t = 256 ACL_READ_EXTATTRIBUTES Acl_perm_t = 512 ACL_WRITE_EXTATTRIBUTES Acl_perm_t = 1024 ACL_READ_SECURITY Acl_perm_t = 2048 ACL_WRITE_SECURITY Acl_perm_t = 4096 ACL_CHANGE_OWNER Acl_perm_t = 8192 ACL_SYNCHRONIZE Acl_perm_t = 1048576 )
func (Acl_perm_t) String ¶
func (e Acl_perm_t) String() string
type Acl_type_t ¶
type Acl_type_t int32
const ( ACL_TYPE_EXTENDED Acl_type_t = 256 ACL_TYPE_ACCESS Acl_type_t = 0 ACL_TYPE_DEFAULT Acl_type_t = 1 ACL_TYPE_AFS Acl_type_t = 2 ACL_TYPE_CODA Acl_type_t = 3 ACL_TYPE_NTFS Acl_type_t = 4 ACL_TYPE_NWFS Acl_type_t = 5 )
func (Acl_type_t) String ¶
func (e Acl_type_t) String() string
type Dispatch_autorelease_frequency_t ¶
type Dispatch_autorelease_frequency_t uint64
const ( DISPATCH_AUTORELEASE_FREQUENCY_INHERIT Dispatch_autorelease_frequency_t = 0 DISPATCH_AUTORELEASE_FREQUENCY_WORK_ITEM Dispatch_autorelease_frequency_t = 1 DISPATCH_AUTORELEASE_FREQUENCY_NEVER Dispatch_autorelease_frequency_t = 2 )
func (Dispatch_autorelease_frequency_t) String ¶
func (e Dispatch_autorelease_frequency_t) String() string
type Dispatch_block_flags_t ¶
type Dispatch_block_flags_t uint64
const ( DISPATCH_BLOCK_BARRIER Dispatch_block_flags_t = 1 DISPATCH_BLOCK_DETACHED Dispatch_block_flags_t = 2 DISPATCH_BLOCK_ASSIGN_CURRENT Dispatch_block_flags_t = 4 DISPATCH_BLOCK_NO_QOS_CLASS Dispatch_block_flags_t = 8 DISPATCH_BLOCK_INHERIT_QOS_CLASS Dispatch_block_flags_t = 16 DISPATCH_BLOCK_ENFORCE_QOS_CLASS Dispatch_block_flags_t = 32 )
func (Dispatch_block_flags_t) String ¶
func (e Dispatch_block_flags_t) String() string
type Filesec_property_t ¶
type Filesec_property_t int32
const ( FILESEC_OWNER Filesec_property_t = 1 FILESEC_GROUP Filesec_property_t = 2 FILESEC_UUID Filesec_property_t = 3 FILESEC_MODE Filesec_property_t = 4 FILESEC_ACL Filesec_property_t = 5 FILESEC_GRPUUID Filesec_property_t = 6 FILESEC_ACL_RAW Filesec_property_t = 100 FILESEC_ACL_ALLOCSIZE Filesec_property_t = 101 )
func (Filesec_property_t) String ¶
func (e Filesec_property_t) String() string
type Ipc_info_object_type_t ¶
type Ipc_info_object_type_t uint32
const ( IPC_OTYPE_NONE Ipc_info_object_type_t = 0 IPC_OTYPE_THREAD_CONTROL Ipc_info_object_type_t = 1 IPC_OTYPE_TASK_CONTROL Ipc_info_object_type_t = 2 IPC_OTYPE_HOST Ipc_info_object_type_t = 3 IPC_OTYPE_HOST_PRIV Ipc_info_object_type_t = 4 IPC_OTYPE_PROCESSOR Ipc_info_object_type_t = 5 IPC_OTYPE_PROCESSOR_SET Ipc_info_object_type_t = 6 IPC_OTYPE_PROCESSOR_SET_NAME Ipc_info_object_type_t = 7 IPC_OTYPE_TIMER Ipc_info_object_type_t = 8 IPC_OTYPE_PORT_SUBST_ONCE Ipc_info_object_type_t = 9 IPC_OTYPE_MIG Ipc_info_object_type_t = 10 IPC_OTYPE_MEMORY_OBJECT Ipc_info_object_type_t = 11 IPC_OTYPE_XMM_PAGER Ipc_info_object_type_t = 12 IPC_OTYPE_XMM_KERNEL Ipc_info_object_type_t = 13 IPC_OTYPE_XMM_REPLY Ipc_info_object_type_t = 14 IPC_OTYPE_UND_REPLY Ipc_info_object_type_t = 15 IPC_OTYPE_HOST_NOTIFY Ipc_info_object_type_t = 16 IPC_OTYPE_HOST_SECURITY Ipc_info_object_type_t = 17 IPC_OTYPE_LEDGER Ipc_info_object_type_t = 18 IPC_OTYPE_MAIN_DEVICE Ipc_info_object_type_t = 19 IPC_OTYPE_TASK_NAME Ipc_info_object_type_t = 20 IPC_OTYPE_SUBSYSTEM Ipc_info_object_type_t = 21 IPC_OTYPE_IO_DONE_QUEUE Ipc_info_object_type_t = 22 IPC_OTYPE_SEMAPHORE Ipc_info_object_type_t = 23 IPC_OTYPE_LOCK_SET Ipc_info_object_type_t = 24 IPC_OTYPE_CLOCK Ipc_info_object_type_t = 25 IPC_OTYPE_CLOCK_CTRL Ipc_info_object_type_t = 26 IPC_OTYPE_IOKIT_IDENT Ipc_info_object_type_t = 27 IPC_OTYPE_NAMED_ENTRY Ipc_info_object_type_t = 28 IPC_OTYPE_IOKIT_CONNECT Ipc_info_object_type_t = 29 IPC_OTYPE_IOKIT_OBJECT Ipc_info_object_type_t = 30 IPC_OTYPE_UPL Ipc_info_object_type_t = 31 IPC_OTYPE_MEM_OBJ_CONTROL Ipc_info_object_type_t = 32 IPC_OTYPE_AU_SESSIONPORT Ipc_info_object_type_t = 33 IPC_OTYPE_FILEPORT Ipc_info_object_type_t = 34 IPC_OTYPE_LABELH Ipc_info_object_type_t = 35 IPC_OTYPE_TASK_RESUME Ipc_info_object_type_t = 36 IPC_OTYPE_VOUCHER Ipc_info_object_type_t = 37 IPC_OTYPE_VOUCHER_ATTR_CONTROL Ipc_info_object_type_t = 38 IPC_OTYPE_WORK_INTERVAL Ipc_info_object_type_t = 39 IPC_OTYPE_UX_HANDLER Ipc_info_object_type_t = 40 IPC_OTYPE_UEXT_OBJECT Ipc_info_object_type_t = 41 IPC_OTYPE_ARCADE_REG Ipc_info_object_type_t = 42 IPC_OTYPE_EVENTLINK Ipc_info_object_type_t = 43 IPC_OTYPE_TASK_INSPECT Ipc_info_object_type_t = 44 IPC_OTYPE_TASK_READ Ipc_info_object_type_t = 45 IPC_OTYPE_THREAD_INSPECT Ipc_info_object_type_t = 46 IPC_OTYPE_THREAD_READ Ipc_info_object_type_t = 47 IPC_OTYPE_SUID_CRED Ipc_info_object_type_t = 48 IPC_OTYPE_HYPERVISOR Ipc_info_object_type_t = 49 IPC_OTYPE_TASK_ID_TOKEN Ipc_info_object_type_t = 50 IPC_OTYPE_TASK_FATAL Ipc_info_object_type_t = 51 IPC_OTYPE_KCDATA Ipc_info_object_type_t = 52 IPC_OTYPE_EXCLAVES_RESOURCE Ipc_info_object_type_t = 53 IPC_OTYPE_THREAD_RESUME Ipc_info_object_type_t = 54 IPC_OTYPE_UNKNOWN Ipc_info_object_type_t = 4294967295 )
func (Ipc_info_object_type_t) String ¶
func (e Ipc_info_object_type_t) String() string
type JSClassDefinition ¶
type JSClassDefinition struct {
Version int32
Attributes uint32
ClassName *byte
ParentClass unsafe.Pointer
StaticValues *JSStaticValue
StaticFunctions *JSStaticFunction
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.
func KJSClassDefinitionEmpty ¶
func KJSClassDefinitionEmpty() JSClassDefinition
@const kJSClassDefinitionEmpty @abstract A JSClassDefinition structure of the current version, filled with NULL pointers and having no attributes. @discussion Use this constant as a convenience when creating class definitions. For example, to create a class definition with only a finalize method: JSClassDefinition definition = kJSClassDefinitionEmpty; definition.finalize = Finalize;
type JSContext ¶
type JSContext struct {
foundation.NSObject
}
A JavaScript execution environment.
Apple documentation: https://developer.apple.com/documentation/javascriptcore/jscontext
func JSContextContextWithJSGlobalContextRef ¶
@method @abstract Create a JSContext, wrapping its C API counterpart. @result The JSContext equivalent of the provided JSGlobalContextRef.
func JSContextCurrentContext ¶
func JSContextCurrentContext() *JSContext
Returns the context currently executing JavaScript code.
func JSContextFromID ¶
func (*JSContext) EvaluateScript ¶
func (o *JSContext) EvaluateScript(script *foundation.NSString) *JSValue
Executes the specified JavaScript code.
func (*JSContext) EvaluateScriptWithSourceURL ¶
func (o *JSContext) EvaluateScriptWithSourceURL(script *foundation.NSString, sourceURL *foundation.NSURL) *JSValue
Executes the specified JavaScript code, treating the specified URL as its source location.
func (*JSContext) Exception ¶
@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).
func (*JSContext) ExceptionHandler ¶
@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.
func (*JSContext) GlobalObject ¶
@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.
func (*JSContext) InitWithVirtualMachine ¶
func (o *JSContext) InitWithVirtualMachine(virtualMachine *JSVirtualMachine) *JSContext
Creates a new JavaScript context associated with a specific virtual machine.
func (*JSContext) IsInspectable ¶
@property @discussion Controls whether this @link JSContext @/link is inspectable in Web Inspector. The default value is NO.
func (*JSContext) JSGlobalContextRef ¶
func (*JSContext) Name ¶
func (o *JSContext) Name() *foundation.NSString
@property @discussion Name of the JSContext. Exposed when inspecting the context.
func (*JSContext) ObjectForKeyedSubscript ¶
Returns the value of the specified JavaScript property in the context’s global object, allowing subscript getter syntax.
func (*JSContext) SetException ¶
func (*JSContext) SetExceptionHandler ¶
func (*JSContext) SetInspectable ¶
func (*JSContext) SetName ¶
func (o *JSContext) SetName(name *foundation.NSString)
func (*JSContext) SetObjectForKeyedSubscript ¶
func (o *JSContext) SetObjectForKeyedSubscript(object objc.ID, key *foundation.NSObject)
Sets the specified JavaScript property of the context’s global object, allowing subscript setter syntax.
func (*JSContext) VirtualMachine ¶
func (o *JSContext) VirtualMachine() *JSVirtualMachine
@property @discussion All instances of JSContext are associated with a JSVirtualMachine.
type JSManagedValue ¶
type JSManagedValue struct {
foundation.NSObject
}
A JavaScript value with conditional retain behavior to provide automatic memory management.
Apple documentation: https://developer.apple.com/documentation/javascriptcore/jsmanagedvalue
func JSManagedValueFromID ¶
func JSManagedValueFromID(id objc.ID) *JSManagedValue
func JSManagedValueManagedValueWithValue ¶
func JSManagedValueManagedValueWithValue(value *JSValue) *JSManagedValue
Creates a managed value with the specified JavaScript value.
func JSManagedValueManagedValueWithValueAndOwner ¶
func JSManagedValueManagedValueWithValueAndOwner(value *JSValue, owner objc.ID) *JSManagedValue
Creates a managed value and associates it with an owner.
func (*JSManagedValue) InitWithValue ¶
func (o *JSManagedValue) InitWithValue(value *JSValue) *JSManagedValue
Initializes a managed value with the specified JavaScript value.
func (*JSManagedValue) Value ¶
func (o *JSManagedValue) Value() *JSValue
type JSRelationCondition ¶
type JSRelationCondition uint32
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
@function @abstract Compares two JSValues. @param ctx The execution context to use. @param left The JSValue as the left operand. @param right The JSValue as the right operand. @param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception. @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 `==`, `<`, and `>` operators. If either `left` or `right` is (or would coerce to) `NaN` in JavaScript, then the result is kJSRelationConditionUndefined.
func JSValueCompareDouble ¶
func JSValueCompareDouble(ctx unsafe.Pointer, left unsafe.Pointer, right float64, exception unsafe.Pointer) JSRelationCondition
@function @abstract Compares a JSValue with a double. @param ctx The execution context to use. @param left The JSValue as the left operand. @param right The double as the right operand. @param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception. @result A value of JSRelationCondition, a kJSRelationConditionUndefined is returned if an exception is thrown. @discussion `left` is converted to a double according to the rules specified by the JavaScript language then compared with `right`.
func JSValueCompareInt64 ¶
func JSValueCompareInt64(ctx unsafe.Pointer, left unsafe.Pointer, right int64, exception unsafe.Pointer) JSRelationCondition
@function @abstract Compares a JSValue with a signed 64-bit integer. @param ctx The execution context to use. @param left The JSValue as the left operand. @param right The int64_t as the right operand. @param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception. @result A value of JSRelationCondition, a kJSRelationConditionUndefined is returned if an exception is thrown. @discussion `left` is converted to an integer according to the rules specified by the JavaScript language then compared with `right`.
func JSValueCompareUInt64 ¶
func JSValueCompareUInt64(ctx unsafe.Pointer, left unsafe.Pointer, right uint64, exception unsafe.Pointer) JSRelationCondition
@function @abstract Compares a JSValue with an unsigned 64-bit integer. @param ctx The execution context to use. @param left The JSValue as the left operand. @param right The uint64_t as the right operand. @param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception. @result A value of JSRelationCondition, a kJSRelationConditionUndefined is returned if an exception is thrown. @discussion `left` is converted to an integer according to the rules specified by the JavaScript language then compared with `right`.
func (JSRelationCondition) String ¶
func (e JSRelationCondition) String() string
type JSStaticFunction ¶
A statically declared function property.
type JSStaticValue ¶
type JSStaticValue struct {
Name *byte
GetProperty unsafe.Pointer
SetProperty unsafe.Pointer
Attributes uint32
}
A statically declared value property.
type JSType ¶
type JSType int32
Constants that identify the type of a JavaScript value.
func JSValueGetType ¶
@function @abstract Returns a JavaScript value's type. @param ctx The execution context to use. @param value The JSValue whose type you want to obtain. @result A value of type JSType that identifies value's type.
type JSTypedArrayType ¶
type JSTypedArrayType int32
The type of a JavaScript typed array object.
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
@function @abstract Returns a JavaScript value's Typed Array type. @param ctx The execution context to use. @param value The JSValue whose Typed Array type to return. @param exception A pointer to a JSValueRef in which to store an exception, if any. To reliable detect exception, initialize this to null before the call. Pass NULL if you do not care to store an exception. @result A value of type JSTypedArrayType that identifies value's Typed Array type, or kJSTypedArrayTypeNone if the value is not a Typed Array object.
func (JSTypedArrayType) String ¶
func (e JSTypedArrayType) String() string
type JSValue ¶
type JSValue struct {
foundation.NSObject
}
A JavaScript value.
Apple documentation: https://developer.apple.com/documentation/javascriptcore/jsvalue
func JSContextCurrentCallee ¶
func JSContextCurrentCallee() *JSValue
Returns the currently executing JavaScript function.
func JSContextCurrentThis ¶
func JSContextCurrentThis() *JSValue
Returns the value of the this keyword in currently executing JavaScript code.
func JSValueFromID ¶
func JSValueValueWithBoolInContext ¶
Creates a JavaScript representation of the specified Boolean value.
func JSValueValueWithDoubleInContext ¶
Creates a JavaScript representation of the specified floating-point value.
func JSValueValueWithInt32InContext ¶
Creates a JavaScript representation of the specified signed integer value.
func JSValueValueWithJSValueRefInContext ¶
@method @abstract Creates a JSValue, wrapping its C API counterpart. @result The Objective-C API equivalent of the specified JSValueRef.
func JSValueValueWithNewArrayInContext ¶
Creates a new, empty JavaScript array value.
func JSValueValueWithNewBigIntFromDoubleInContext ¶
@method @abstract Create a new BigInt value from a double. @param value The value of the BigInt JavaScript value being created. @param context The JSContext to which the resulting JSValue belongs. @result The JSValue representing a JavaScript value with type BigInt. @discussion If the value is not an integer, an exception is thrown.
func JSValueValueWithNewBigIntFromInt64InContext ¶
@method @abstract Create a new BigInt value from a <code>int64_t</code>. @param int64 The signed 64-bit integer of the BigInt JavaScript value being created. @param context The JSContext to which the resulting JSValue belongs. @result The JSValue representing a JavaScript value with type BigInt.
func JSValueValueWithNewBigIntFromStringInContext ¶
func JSValueValueWithNewBigIntFromStringInContext(string_ *foundation.NSString, context_ *JSContext) *JSValue
@method @abstract Create a new BigInt value from a numeric string. @param string The string representation of the BigInt JavaScript value being created. @param context The JSContext to which the resulting JSValue belongs. @result The JSValue representing a JavaScript value with type BigInt. @discussion This is equivalent to calling the <code>BigInt</code> constructor from JavaScript with a string argument.
func JSValueValueWithNewBigIntFromUInt64InContext ¶
@method @abstract Create a new BigInt value from a <code>uint64_t</code>. @param uint64 The unsigned 64-bit integer of the BigInt JavaScript value being created. @param context The JSContext to which the resulting JSValue belongs. @result The JSValue representing a JavaScript value with type BigInt.
func JSValueValueWithNewErrorFromMessageInContext ¶
func JSValueValueWithNewErrorFromMessageInContext(message *foundation.NSString, context_ *JSContext) *JSValue
Creates a JavaScript error value with the specified error message.
func JSValueValueWithNewObjectInContext ¶
Creates a new, empty JavaScript object value.
func JSValueValueWithNewPromiseInContextFromExecutor ¶
func JSValueValueWithNewPromiseInContextFromExecutor(context_ *JSContext, callback func(*JSValue, *JSValue)) *JSValue
Creates a promise object using the specified executor callback.
func JSValueValueWithNewPromiseRejectedWithReasonInContext ¶
func JSValueValueWithNewPromiseRejectedWithReasonInContext(reason objc.ID, context_ *JSContext) *JSValue
Creates a rejected promise object with the specified value.
func JSValueValueWithNewPromiseResolvedWithResultInContext ¶
func JSValueValueWithNewPromiseResolvedWithResultInContext(result objc.ID, context_ *JSContext) *JSValue
Creates a resolved promise object with the specified value.
func JSValueValueWithNewRegularExpressionFromPatternFlagsInContext ¶
func JSValueValueWithNewRegularExpressionFromPatternFlagsInContext(pattern *foundation.NSString, flags *foundation.NSString, context_ *JSContext) *JSValue
Creates a JavaScript regular expression value from the specified pattern.
func JSValueValueWithNewSymbolFromDescriptionInContext ¶
func JSValueValueWithNewSymbolFromDescriptionInContext(description *foundation.NSString, context_ *JSContext) *JSValue
Creates a unique symbol object.
func JSValueValueWithNullInContext ¶
Creates a JavaScript null value.
func JSValueValueWithObjectInContext ¶
Creates a JavaScript value by converting the specified native object.
func JSValueValueWithPointInContext ¶
func JSValueValueWithPointInContext(point corefoundation.CGPoint, context_ *JSContext) *JSValue
@method @abstract Create a JSValue from a CGPoint. @result A newly allocated JavaScript object containing properties named <code>x</code> and <code>y</code>, with values from the CGPoint.
func JSValueValueWithRangeInContext ¶
func JSValueValueWithRangeInContext(range_ foundation.NSRange, context_ *JSContext) *JSValue
@method @abstract Create a JSValue from a NSRange. @result A newly allocated JavaScript object containing properties named <code>location</code> and <code>length</code>, with values from the NSRange.
func JSValueValueWithRectInContext ¶
func JSValueValueWithRectInContext(rect corefoundation.CGRect, context_ *JSContext) *JSValue
@method @abstract Create a JSValue from a CGRect. @result A newly allocated JavaScript object containing properties named <code>x</code>, <code>y</code>, <code>width</code>, and <code>height</code>, with values from the CGRect.
func JSValueValueWithSizeInContext ¶
func JSValueValueWithSizeInContext(size corefoundation.CGSize, context_ *JSContext) *JSValue
@method @abstract Create a JSValue from a CGSize. @result A newly allocated JavaScript object containing properties named <code>width</code> and <code>height</code>, with values from the CGSize.
func JSValueValueWithUInt32InContext ¶
Creates a JavaScript representation of the specified unsigned integer value.
func JSValueValueWithUndefinedInContext ¶
Creates a JavaScript undefined value.
func (*JSValue) CallWithArguments ¶
Invokes the value as a JavaScript function.
func (*JSValue) CompareDouble ¶
func (o *JSValue) 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>.
func (*JSValue) CompareInt64 ¶
func (o *JSValue) 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>.
func (*JSValue) CompareJSValue ¶
func (o *JSValue) CompareJSValue(other *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.
func (*JSValue) CompareUInt64 ¶
func (o *JSValue) 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>.
func (*JSValue) ConstructWithArguments ¶
Invokes the value as a JavaScript constructor.
func (*JSValue) DefinePropertyDescriptor ¶
Defines a property on the JavaScript object value or modifies a property’s definition.
func (*JSValue) DeleteProperty ¶
Deletes the named property from the JavaScript object value.
func (*JSValue) HasProperty ¶
Returns a Boolean value indicating whether the JavaScript value has a defined property with the specified name.
func (*JSValue) InvokeMethodWithArguments ¶
func (o *JSValue) InvokeMethodWithArguments(method *foundation.NSString, arguments *foundation.NSArray[objc.ID]) *JSValue
Calls the named JavaScript method on the value.
func (*JSValue) IsEqualToObject ¶
Compares the value to another for strict equality.
func (*JSValue) IsEqualWithTypeCoercionToObject ¶
Compares the value to another for equivalence, allowing type conversion.
func (*JSValue) IsInstanceOf ¶
Returns a Boolean value indicating whether the value is an instance of another JavaScript object value.
func (*JSValue) IsNull ¶
@property @abstract Check if a JSValue corresponds to the JavaScript value <code>null</code>.
func (*JSValue) IsNumber ¶
@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.
func (*JSValue) IsUndefined ¶
@property @abstract Check if a JSValue corresponds to the JavaScript value <code>undefined</code>.
func (*JSValue) JSValueRef ¶
func (*JSValue) ObjectAtIndexedSubscript ¶
Returns the value’s JavaScript property at the specified index, allowing subscript syntax.
func (*JSValue) ObjectForKeyedSubscript ¶
Returns the value’s JavaScript property named with the specified key, allowing subscript syntax.
func (*JSValue) SetObjectAtIndexedSubscript ¶
Sets the value’s JavaScript property at the specified index, allowing subscript syntax.
func (*JSValue) SetObjectForKeyedSubscript ¶
Sets the value’s JavaScript property named with the specified key, allowing subscript syntax.
func (*JSValue) SetValueAtIndex ¶
Sets the value at the specified numeric index in the JavaScript object value.
func (*JSValue) SetValueForProperty ¶
Sets the value of the named property in the JavaScript object value.
func (*JSValue) ToArray ¶
func (o *JSValue) ToArray() *foundation.NSArray[objc.ID]
Converts the JavaScript value to an array.
func (*JSValue) ToDate ¶
func (o *JSValue) ToDate() *foundation.NSDate
Converts the JavaScript value to a date object.
func (*JSValue) ToDictionary ¶
func (o *JSValue) ToDictionary() *foundation.NSDictionary[objc.ID, objc.ID]
Converts the JavaScript value to a dictionary.
func (*JSValue) ToInt64 ¶
@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>.
func (*JSValue) ToNumber ¶
func (o *JSValue) ToNumber() *foundation.NSNumber
Converts the JavaScript value to a NSNumber object.
func (*JSValue) ToObjectOfClass ¶
Converts the JavaScript value to a native object of the specified class.
func (*JSValue) ToPoint ¶
func (o *JSValue) ToPoint() corefoundation.CGPoint
Converts the value to a point structure.
func (*JSValue) ToRange ¶
func (o *JSValue) ToRange() foundation.NSRange
Converts the value to a range.
func (*JSValue) ToRect ¶
func (o *JSValue) ToRect() corefoundation.CGRect
Converts the value to a rectangle structure.
func (*JSValue) ToSize ¶
func (o *JSValue) ToSize() corefoundation.CGSize
Converts the value to a size.
func (*JSValue) ToString ¶
func (o *JSValue) ToString() *foundation.NSString
Converts the JavaScript value to a native string.
func (*JSValue) ToUInt64 ¶
@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>.
func (*JSValue) ValueAtIndex ¶
Returns the value at the specified numeric index in the JavaScript object value.
type JSVirtualMachine ¶
type JSVirtualMachine struct {
foundation.NSObject
}
A self-contained environment for JavaScript execution.
Apple documentation: https://developer.apple.com/documentation/javascriptcore/jsvirtualmachine
func JSVirtualMachineFromID ¶
func JSVirtualMachineFromID(id objc.ID) *JSVirtualMachine
func (*JSVirtualMachine) AddManagedReferenceWithOwner ¶
func (o *JSVirtualMachine) AddManagedReferenceWithOwner(object objc.ID, owner objc.ID)
Notifies the JavaScriptCore virtual machine of an external object relationship.
func (*JSVirtualMachine) Init ¶
func (o *JSVirtualMachine) Init() *JSVirtualMachine
Initializes a JavaScript virtual machine.
func (*JSVirtualMachine) RemoveManagedReferenceWithOwner ¶
func (o *JSVirtualMachine) RemoveManagedReferenceWithOwner(object objc.ID, owner objc.ID)
Notifies the JavaScriptCore virtual machine that a previously registered object relationship no longer exists.
type Launch_data_type_t ¶
type Launch_data_type_t int32
const ( LAUNCH_DATA_DICTIONARY Launch_data_type_t = 1 LAUNCH_DATA_ARRAY Launch_data_type_t = 2 LAUNCH_DATA_FD Launch_data_type_t = 3 LAUNCH_DATA_INTEGER Launch_data_type_t = 4 LAUNCH_DATA_REAL Launch_data_type_t = 5 LAUNCH_DATA_BOOL Launch_data_type_t = 6 LAUNCH_DATA_STRING Launch_data_type_t = 7 LAUNCH_DATA_OPAQUE Launch_data_type_t = 8 LAUNCH_DATA_ERRNO Launch_data_type_t = 9 LAUNCH_DATA_MACHPORT Launch_data_type_t = 10 )
func (Launch_data_type_t) String ¶
func (e Launch_data_type_t) String() string
type MDLabelDomain ¶
type MDLabelDomain int32
@typedef MDLabelDomain @abstract 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
type MDQueryOptionFlags ¶
type MDQueryOptionFlags int32
const ( KMDQuerySynchronous MDQueryOptionFlags = 1 KMDQueryWantsUpdates MDQueryOptionFlags = 4 KMDQueryAllowFSTranslation MDQueryOptionFlags = 8 )
func (MDQueryOptionFlags) String ¶
func (e MDQueryOptionFlags) String() string
type MDQuerySortOptionFlags ¶
type MDQuerySortOptionFlags int32
@enum MDQuerySortOptionFlags @constant kMDQueryReverseSortOrderFlag Sort the attribute in reverse order.
const (
KMDQueryReverseSortOrderFlag MDQuerySortOptionFlags = 1
)
func (MDQuerySortOptionFlags) String ¶
func (e MDQuerySortOptionFlags) String() string
type Mach_vm_range_flags_t ¶
type Mach_vm_range_flags_t uint64
const (
MACH_VM_RANGE_NONE Mach_vm_range_flags_t = 0
)
func (Mach_vm_range_flags_t) String ¶
func (e Mach_vm_range_flags_t) String() string
type Mach_vm_range_flavor_t ¶
type Mach_vm_range_flavor_t uint32
const ( MACH_VM_RANGE_FLAVOR_INVALID Mach_vm_range_flavor_t = 0 MACH_VM_RANGE_FLAVOR_V1 Mach_vm_range_flavor_t = 1 )
func (Mach_vm_range_flavor_t) String ¶
func (e Mach_vm_range_flavor_t) String() string
type Mach_vm_range_tag_t ¶
type Mach_vm_range_tag_t uint16
const ( MACH_VM_RANGE_DEFAULT Mach_vm_range_tag_t = 0 MACH_VM_RANGE_DATA Mach_vm_range_tag_t = 1 MACH_VM_RANGE_FIXED Mach_vm_range_tag_t = 2 )
func (Mach_vm_range_tag_t) String ¶
func (e Mach_vm_range_tag_t) String() string
type Mpo_flags_t ¶
type Mpo_flags_t uint32
const ( MPO_PORT Mpo_flags_t = 0 MPO_SERVICE_PORT Mpo_flags_t = 1024 MPO_CONNECTION_PORT Mpo_flags_t = 2048 MPO_REPLY_PORT Mpo_flags_t = 4096 MPO_WEAK_REPLY_PORT Mpo_flags_t = 16384 MPO_NOTIFICATION_PORT Mpo_flags_t = 17408 MPO_EXCEPTION_PORT Mpo_flags_t = 32768 MPO_CONNECTION_PORT_WITH_PORT_ARRAY Mpo_flags_t = 65536 )
func (Mpo_flags_t) String ¶
func (e Mpo_flags_t) String() string
type OpaqueJSClass ¶
type OpaqueJSClass struct{}
@typedef JSClassRef A JavaScript class. Used with JSObjectMake to construct objects with custom behavior. OpaqueJSClass is an opaque type.
type OpaqueJSContext ¶
type OpaqueJSContext struct{}
@typedef JSContextRef A JavaScript execution context. Holds the global object and other execution state. OpaqueJSContext is an opaque type.
type OpaqueJSContextGroup ¶
type OpaqueJSContextGroup struct{}
@typedef JSContextGroupRef A group that associates JavaScript contexts with one another. Contexts in the same group may share and exchange JavaScript objects. OpaqueJSContextGroup is an opaque type.
type OpaqueJSPropertyNameAccumulator ¶
type OpaqueJSPropertyNameAccumulator struct{}
@typedef JSPropertyNameAccumulatorRef An ordered set used to collect the names of a JavaScript object's properties. OpaqueJSPropertyNameAccumulator is an opaque type.
type OpaqueJSPropertyNameArray ¶
type OpaqueJSPropertyNameArray struct{}
@typedef JSPropertyNameArrayRef An array of JavaScript property names. OpaqueJSPropertyNameArray is an opaque type.
type OpaqueJSString ¶
type OpaqueJSString struct{}
@typedef JSStringRef A UTF16 character buffer. The fundamental string representation in JavaScript. OpaqueJSString is an opaque type.
type OpaqueJSValue ¶
type OpaqueJSValue struct{}
@typedef JSValueRef A JavaScript value. The base type for all JavaScript values, and polymorphic functions on them. OpaqueJSValue is an opaque type.
type Os_clockid_t ¶
type Os_clockid_t uint32
const (
OS_CLOCK_MACH_ABSOLUTE_TIME Os_clockid_t = 32
)
func (Os_clockid_t) String ¶
func (e Os_clockid_t) String() string
type Ptrauth_key ¶
type Ptrauth_key int32
const ( Ptrauth_key_none Ptrauth_key = -1 Ptrauth_key_asia Ptrauth_key = 0 Ptrauth_key_asib Ptrauth_key = 1 Ptrauth_key_asda Ptrauth_key = 2 Ptrauth_key_asdb Ptrauth_key = 3 Ptrauth_key_process_independent_code Ptrauth_key = 0 Ptrauth_key_process_dependent_code Ptrauth_key = 1 Ptrauth_key_process_independent_data Ptrauth_key = 2 Ptrauth_key_process_dependent_data Ptrauth_key = 3 Ptrauth_key_return_address Ptrauth_key = 1 Ptrauth_key_frame_pointer Ptrauth_key = 3 Ptrauth_key_function_pointer Ptrauth_key = 0 Ptrauth_key_block_function Ptrauth_key = 0 Ptrauth_key_cxx_vtable_pointer Ptrauth_key = 2 Ptrauth_key_method_list_pointer Ptrauth_key = 2 Ptrauth_key_objc_isa_pointer Ptrauth_key = 2 Ptrauth_key_objc_super_pointer Ptrauth_key = 2 Ptrauth_key_objc_sel_pointer Ptrauth_key = 3 Ptrauth_key_objc_class_ro_pointer Ptrauth_key = 2 Ptrauth_key_block_descriptor_pointer Ptrauth_key = 2 Ptrauth_key_init_fini_pointer Ptrauth_key = 0 )
func (Ptrauth_key) String ¶
func (e Ptrauth_key) String() string
type Qos_class_t ¶
type Qos_class_t uint32
const ( QOS_CLASS_USER_INTERACTIVE Qos_class_t = 33 QOS_CLASS_USER_INITIATED Qos_class_t = 25 QOS_CLASS_DEFAULT Qos_class_t = 21 QOS_CLASS_UTILITY Qos_class_t = 17 QOS_CLASS_BACKGROUND Qos_class_t = 9 QOS_CLASS_UNSPECIFIED Qos_class_t = 0 )
func (Qos_class_t) String ¶
func (e Qos_class_t) String() string
type Virtual_memory_guard_exception_code_t ¶
type Virtual_memory_guard_exception_code_t uint32
const ( KGUARD_EXC_DEALLOC_GAP Virtual_memory_guard_exception_code_t = 1 KGUARD_EXC_RECLAIM_COPYIO_FAILURE Virtual_memory_guard_exception_code_t = 2 KGUARD_EXC_RECLAIM_INDEX_FAILURE Virtual_memory_guard_exception_code_t = 4 KGUARD_EXC_RECLAIM_DEALLOCATE_FAILURE Virtual_memory_guard_exception_code_t = 8 KGUARD_EXC_RECLAIM_ACCOUNTING_FAILURE Virtual_memory_guard_exception_code_t = 9 KGUARD_EXC_SEC_IOPL_ON_EXEC_PAGE Virtual_memory_guard_exception_code_t = 10 KGUARD_EXC_SEC_EXEC_ON_IOPL_PAGE Virtual_memory_guard_exception_code_t = 11 KGUARD_EXC_SEC_UPL_WRITE_ON_EXEC_REGION Virtual_memory_guard_exception_code_t = 12 KGUARD_EXC_LARGE_ALLOCATION_TELEMETRY Virtual_memory_guard_exception_code_t = 13 KGUARD_EXC_SEC_ACCESS_FAULT Virtual_memory_guard_exception_code_t = 98 KGUARD_EXC_SEC_ASYNC_ACCESS_FAULT Virtual_memory_guard_exception_code_t = 99 KGUARD_EXC_SEC_COPY_DENIED Virtual_memory_guard_exception_code_t = 100 KGUARD_EXC_SEC_SHARING_DENIED Virtual_memory_guard_exception_code_t = 101 KGUARD_EXC_MTE_SYNC_FAULT Virtual_memory_guard_exception_code_t = 200 KGUARD_EXC_MTE_ASYNC_USER_FAULT Virtual_memory_guard_exception_code_t = 201 KGUARD_EXC_MTE_ASYNC_KERN_FAULT Virtual_memory_guard_exception_code_t = 202 KGUARD_EXC_GUARD_OBJECT_ASYNC_USER_FAULT Virtual_memory_guard_exception_code_t = 203 KGUARD_EXC_GUARD_OBJECT_ASYNC_KERN_FAULT Virtual_memory_guard_exception_code_t = 204 )
func (Virtual_memory_guard_exception_code_t) String ¶
func (e Virtual_memory_guard_exception_code_t) String() string
type Xpc_listener_create_flags_t ¶
type Xpc_listener_create_flags_t uint64
const ( XPC_LISTENER_CREATE_NONE Xpc_listener_create_flags_t = 0 XPC_LISTENER_CREATE_INACTIVE Xpc_listener_create_flags_t = 1 XPC_LISTENER_CREATE_FORCE_MACH Xpc_listener_create_flags_t = 2 XPC_LISTENER_CREATE_FORCE_XPCSERVICE Xpc_listener_create_flags_t = 4 )
func (Xpc_listener_create_flags_t) String ¶
func (e Xpc_listener_create_flags_t) String() string
type Xpc_session_create_flags_t ¶
type Xpc_session_create_flags_t uint64
const ( XPC_SESSION_CREATE_NONE Xpc_session_create_flags_t = 0 XPC_SESSION_CREATE_INACTIVE Xpc_session_create_flags_t = 1 XPC_SESSION_CREATE_MACH_PRIVILEGED Xpc_session_create_flags_t = 2 )
func (Xpc_session_create_flags_t) String ¶
func (e Xpc_session_create_flags_t) String() string