JSValueRef.h

A JavaScript value that is the base type for all JavaScript values and the polymorphic functions on them.

Topics

Functions

func JSValueCreateJSONString(JSContextRef!, JSValueRef!, UInt32, UnsafeMutablePointer<JSValueRef?>!)

Creates a JavaScript string containing the JSON serialized representation of a JavaScript value.

func JSValueGetType(JSContextRef!, JSValueRef!)

Returns a JavaScript value's type.

func JSValueIsBoolean(JSContextRef!, JSValueRef!)

Tests whether a JavaScript value is boolean.

func JSValueIsEqual(JSContextRef!, JSValueRef!, JSValueRef!, UnsafeMutablePointer<JSValueRef?>!)

Tests whether two JavaScript values are equal, as compared by the JS == operator.

func JSValueIsInstanceOfConstructor(JSContextRef!, JSValueRef!, JSObjectRef!, UnsafeMutablePointer<JSValueRef?>!)

Tests whether a JavaScript value is an object constructed by a given constructor, as compared by the isInstance(of:) operator.

func JSValueIsNull(JSContextRef!, JSValueRef!)

Tests whether a JavaScript value's type is the null type.

func JSValueIsNumber(JSContextRef!, JSValueRef!)

Tests whether a JavaScript value's type is the number type.

func JSValueIsObject(JSContextRef!, JSValueRef!)

Tests whether a JavaScript value's type is the object type.

func JSValueIsObjectOfClass(JSContextRef!, JSValueRef!, JSClassRef!)

Tests whether a JavaScript value is an object with a given class in its class chain.

func JSValueIsStrictEqual(JSContextRef!, JSValueRef!, JSValueRef!)

Tests whether two JavaScript values are strict equal, as compared by the JS === operator.

func JSValueIsString(JSContextRef!, JSValueRef!)

Tests whether a JavaScript value's type is the string type.

func JSValueIsUndefined(JSContextRef!, JSValueRef!)

Tests whether a JavaScript value's type is the undefined type.

func JSValueMakeBoolean(JSContextRef!, Bool)

Creates a JavaScript value of the boolean type.

func JSValueMakeFromJSONString(JSContextRef!, JSStringRef!)

Creates a JavaScript value from a JSON formatted string.

func JSValueMakeNull(JSContextRef!)

Creates a JavaScript value of the null type.

func JSValueMakeNumber(JSContextRef!, Double)

Creates a JavaScript value of the number type.

func JSValueMakeString(JSContextRef!, JSStringRef!)

Creates a JavaScript value of the string type.

func JSValueMakeUndefined(JSContextRef!)

Creates a JavaScript value of the undefined type.

func JSValueProtect(JSContextRef!, JSValueRef!)

Protects a JavaScript value from garbage collection.

func JSValueToBoolean(JSContextRef!, JSValueRef!)

Converts a JavaScript value to boolean and returns the resulting boolean.

func JSValueToNumber(JSContextRef!, JSValueRef!, UnsafeMutablePointer<JSValueRef?>!)

Converts a JavaScript value to number and returns the resulting number.

func JSValueToObject(JSContextRef!, JSValueRef!, UnsafeMutablePointer<JSValueRef?>!)

Converts a JavaScript value to object and returns the resulting object.

func JSValueToStringCopy(JSContextRef!, JSValueRef!, UnsafeMutablePointer<JSValueRef?>!)

Converts a JavaScript value to string and copies the result into a JavaScript string.

func JSValueUnprotect(JSContextRef!, JSValueRef!)

Unprotects a JavaScript value from garbage collection.

Data Types

struct JSType

A constant identifying the type of a JSValue.

See Also

Legacy JavaScriptCore APIs

JSBase.h

Defines the JavaScriptCore interface engine

JSObjectRef.h

A JavaScript Object

JSStringRef.h

A UTF16 character buffer that is the fundamental string representation in JavaScript.

JSStringRefCF.h

Contains CFString convenience methods.