Platforms to show: All Mac Windows Linux Cross-Platform

Back to JSValueMBS class.

JSValueMBS.Constructor   Private

Type Topic Plugin Version macOS Windows Linux iOS Targets
method JavaScript MBS MacFrameworks Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
The private constructor.

JSValueMBS.DoubleValue(byref JSException as JSValueMBS) as Double

Type Topic Plugin Version macOS Windows Linux iOS Targets
method JavaScript MBS MacFrameworks Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Converts a JavaScript value to number and returns the resulting number.

Returns the numeric result of conversion, or NaN if an exception is thrown.

See also:

JSValueMBS.IsEqual(OtherValue as JSValueMBS, byref JSException as JSValueMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method JavaScript MBS MacFrameworks Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Tests whether two JavaScript values are equal, as compared by the JS == operator.
Example
dim c as new JSContextMBS
dim s1 as JSValueMBS = c.valueWithJSON("""Hello""")
dim s2 as JSValueMBS = c.valueWithJSON("""Hello""")
dim e as JSValueMBS
MsgBox str(s1.IsEqual(s2, e))

OtherValue The second value to test.
exception: A JSValueMBS in which to store an exception, if any.
Returns true if the two values are equal, false if they are not equal or an exception is thrown.

JSValueMBS.IsInstanceOfConstructor(ConstructorFunction as JSObjectMBS, byref JSException as JSValueMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method JavaScript MBS MacFrameworks Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Tests whether a JavaScript value is an object constructed by a given constructor, as compared by the JS instanceof operator.

ConstructorFunction: The constructor to test against.
JSException: A JSValueMBS in which to store an exception, if any.
Returns true if value is an object constructed by constructor, as compared by the JS instanceof operator, otherwise false.

JSValueMBS.IsObjectOfClass(ClassObject as JSValueMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method JavaScript MBS MacFrameworks Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Tests whether a JavaScript value is an object with a given class in its class chain.

ClassObject The JSClass to test against.
Returns true if value is an object and has jsClass in its class chain, otherwise false.

JSValueMBS.IsStrictEqual(OtherValue as JSValueMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method JavaScript MBS MacFrameworks Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Tests whether two JavaScript values are strict equal, as compared by the JS === operator.
Example
dim c as new JSContextMBS
dim j1 as JSValueMBS = c.valueWithDouble(1)
dim j2 as JSValueMBS = c.valueWithDouble(2)

MsgBox str(j1.IsStrictEqual(j2)) // false
MsgBox str(j1.IsStrictEqual(j1)) // true

OtherValue: The second value to test.
Returns true if the two values are strict equal, otherwise false.

JSValueMBS.JSONString(indent as Integer = 0, byref JSException as JSValueMBS) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method JavaScript MBS MacFrameworks Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Creates a JavaScript string containing the JSON serialized representation of a JS value.
Example
dim c as new JSContextMBS
dim j as JSValueMBS = c.valueWithJSON("{""tag"":""Hello"", ""value"":1}")
dim e as JSValueMBS
MsgBox j.JSONString(5, e)

Requires Mac OS X 10.7 and newer.

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.
JSException: A JSValueMBS in which to store an exception, if any.
Returns a JSString with the result of serialization, or nil if an exception is thrown.

See also:

JSValueMBS.ObjectValue(byref JSException as JSValueMBS) as JSValueMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method JavaScript MBS MacFrameworks Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Converts a JavaScript value to object and returns the resulting object.

JSException: A JSValueMBS in which to store an exception, if any.
Returns the JSObject result of conversion, or nil if an exception is thrown.

JSValueMBS.StringValue(byref JSException as JSValueMBS) as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method JavaScript MBS MacFrameworks Plugin 15.4 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Converts a JavaScript value to string and copies the result into a JavaScript string.

JSException: A JSValueMBS in which to store an exception, if any.
Returns a JSString with the result of conversion, or nil if an exception is thrown.

See also:

The items on this page are in the following plugins: MBS MacFrameworks Plugin.


The biggest plugin in space...