Type Method

valueWithNewErrorFromMessage:inContext:

Creates a JavaScript error value with the specified error message.

Declaration

+ (JSValue *)valueWithNewErrorFromMessage:(NSString *)message inContext:(JSContext *)context;

Parameters

message

The error message for the error object.

context

The JavaScript context in which to create the value.

Return Value

A new JavaScript error value.

Discussion

Calling this method creates a JavaScript Error object, and is equivalent to calling the Error constructor (for example, new Error("message")) in JavaScript.

See Also

Creating JavaScript Values

+ valueWithObject:inContext:

Creates a JavaScript value by converting the specified native object.

+ valueWithBool:inContext:

Creates a JavaScript representation of the specified Boolean value.

+ valueWithDouble:inContext:

Creates a JavaScript representation of the specified floating-point value.

+ valueWithInt32:inContext:

Creates a JavaScript representation of the specified signed integer value.

+ valueWithUInt32:inContext:

Creates a JavaScript representation of the specified unsigned integer value.

+ valueWithNewObjectInContext:

Creates a new, empty JavaScript object value.

+ valueWithNewArrayInContext:

Creates a new, empty JavaScript array value.

+ valueWithNewRegularExpressionFromPattern:flags:inContext:

Creates a JavaScript regular expression value from the specified pattern.

+ valueWithUndefinedInContext:

Creates a JavaScript undefined value.

+ valueWithNullInContext:

Creates a JavaScript null value.

+ valueWithPoint:inContext:

Creates a JavaScript representation of the specified point.

+ valueWithRange:inContext:

Creates a JavaScript representation of the specified range.

+ valueWithRect:inContext:

Creates a JavaScript representation of the specified rectangle.

+ valueWithSize:inContext:

Creates a JavaScript representation of the specified width and height.