internal static extern JavaScriptErrorCode JsStrictEquals(JavaScriptValue obj1, JavaScriptValue obj2, out bool result);
/// <summary> /// Creates a new JavaScript URIError error object /// </summary> /// <remarks> /// Requires an active script context. /// </remarks> /// <param name="message">Message for the error object.</param> /// <returns>The new error object.</returns> public static JavaScriptValue CreateUriError(JavaScriptValue message) { JavaScriptValue reference; Native.ThrowIfError(Native.JsCreateURIError(message, out reference)); return reference; }
/// <summary> /// Retrieve the value at the specified index of an object. /// </summary> /// <remarks> /// Requires an active script context. /// </remarks> /// <param name="index">The index to retrieve.</param> /// <returns>The retrieved value.</returns> public JavaScriptValue GetIndexedProperty(JavaScriptValue index) { JavaScriptValue propertyReference; Native.ThrowIfError(Native.JsGetIndexedProperty(this, index, out propertyReference)); return propertyReference; }
internal static extern JavaScriptErrorCode JsGetOwnPropertySymbols(JavaScriptValue obj, out JavaScriptValue propertySymbols);
internal static extern JavaScriptErrorCode JsInstanceOf(JavaScriptValue obj, JavaScriptValue constructor, out bool result);
internal static extern JavaScriptErrorCode JsCreateTypedArray(JavaScriptTypedArrayType arrayType, JavaScriptValue arrayBuffer, uint byteOffset, uint elementLength, out JavaScriptValue result);
internal static extern JavaScriptErrorCode JsGetDataViewStorage(JavaScriptValue dataView, out byte[] buffer, out uint bufferLength);
internal static extern JavaScriptErrorCode JsCreateFunction(JavaScriptNativeFunction nativeFunction, IntPtr externalData, out JavaScriptValue function);
internal static extern JavaScriptErrorCode JsCreateURIError(JavaScriptValue message, out JavaScriptValue error);
internal static extern JavaScriptErrorCode JsCallFunction(JavaScriptValue function, JavaScriptValue[] arguments, ushort argumentCount, out JavaScriptValue result);
internal static extern JavaScriptErrorCode JsConstructObject(JavaScriptValue function, JavaScriptValue[] arguments, ushort argumentCount, out JavaScriptValue result);
internal static extern JavaScriptErrorCode JsCreateArray(uint length, out JavaScriptValue result);
internal static extern JavaScriptErrorCode JsSetExternalData(JavaScriptValue obj, IntPtr externalData);
internal static extern JavaScriptErrorCode JsHasExternalData(JavaScriptValue obj, out bool value);
internal static extern JavaScriptErrorCode JsSetException(JavaScriptValue exception);
internal static extern JavaScriptErrorCode JsGetAndClearException(out JavaScriptValue exception);
internal static extern JavaScriptErrorCode JsCreateNamedFunction(JavaScriptValue name, JavaScriptNativeFunction nativeFunction, IntPtr callbackState, out JavaScriptValue function);
internal static extern JavaScriptErrorCode JsSetException(JavaScriptValue exception);
internal static extern JavaScriptErrorCode JsGetArrayBufferStorage(JavaScriptValue arrayBuffer, out byte[] buffer, out uint bufferLength);
internal static extern JavaScriptErrorCode JsSetObjectBeforeCollectCallback(JavaScriptValue reference, IntPtr callbackState, JavaScriptObjectBeforeCollectCallback beforeCollectCallback);
internal static extern JavaScriptErrorCode JsGetSymbolFromPropertyId(JavaScriptPropertyId propertyId, out JavaScriptValue symbol);
internal static extern JavaScriptErrorCode JsCreateNamedFunction(JavaScriptValue name, JavaScriptNativeFunction nativeFunction, IntPtr callbackState, out JavaScriptValue function);
internal static extern JavaScriptErrorCode JsGetIndexedPropertiesExternalData(JavaScriptValue obj, IntPtr data, out JavaScriptTypedArrayType arrayType, out uint elementLength);
internal static extern JavaScriptErrorCode JsCreateArrayBuffer(uint byteLength, out JavaScriptValue result);
internal static extern JavaScriptErrorCode JsGetContextOfObject(JavaScriptValue obj, out JavaScriptContext context);
internal static extern JavaScriptErrorCode JsCreateTypedArray(JavaScriptTypedArrayType arrayType, JavaScriptValue arrayBuffer, uint byteOffset, uint elementLength, out JavaScriptValue result);
/// <summary> /// Defines a new object's own property from a property descriptor. /// </summary> /// <remarks> /// Requires an active script context. /// </remarks> /// <param name="propertyId">The ID of the property.</param> /// <param name="propertyDescriptor">The property descriptor.</param> /// <returns>Whether the property was defined.</returns> public bool DefineProperty(JavaScriptPropertyId propertyId, JavaScriptValue propertyDescriptor) { bool result; Native.ThrowIfError(Native.JsDefineProperty(this, propertyId, propertyDescriptor, out result)); return result; }
internal static extern JavaScriptErrorCode JsCreateDataView(JavaScriptValue arrayBuffer, uint byteOffset, uint byteOffsetLength, out JavaScriptValue result);
/// <summary> /// Delete the value at the specified index of an object. /// </summary> /// <remarks> /// Requires an active script context. /// </remarks> /// <param name="index">The index to delete.</param> public void DeleteIndexedProperty(JavaScriptValue index) { Native.ThrowIfError(Native.JsDeleteIndexedProperty(this, index)); }
internal static extern JavaScriptErrorCode JsGetArrayBufferStorage(JavaScriptValue arrayBuffer, out byte[] buffer, out uint bufferLength);
internal static extern JavaScriptErrorCode JsGetAndClearException(out JavaScriptValue exception);
internal static extern JavaScriptErrorCode JsGetTypedArrayStorage(JavaScriptValue typedArray, out byte[] buffer, out uint bufferLength, out JavaScriptTypedArrayType arrayType, out int elementSize);
internal static extern JavaScriptErrorCode JsSetObjectBeforeCollectCallback(JavaScriptValue reference, IntPtr callbackState, JavaScriptObjectBeforeCollectCallback beforeCollectCallback);
internal static extern JavaScriptErrorCode JsGetDataViewStorage(JavaScriptValue dataView, out byte[] buffer, out uint bufferLength);
internal static extern JavaScriptErrorCode JsCreateArrayBuffer(uint byteLength, out JavaScriptValue result);
internal static extern JavaScriptErrorCode JsCreateSymbol(JavaScriptValue description, out JavaScriptValue symbol);
internal static extern JavaScriptErrorCode JsCreateDataView(JavaScriptValue arrayBuffer, uint byteOffset, uint byteOffsetLength, out JavaScriptValue result);
internal static extern JavaScriptErrorCode JsGetSymbolFromPropertyId(JavaScriptPropertyId propertyId, out JavaScriptValue symbol);
internal static extern JavaScriptErrorCode JsGetTypedArrayStorage(JavaScriptValue typedArray, out byte[] buffer, out uint bufferLength, out JavaScriptTypedArrayType arrayType, out int elementSize);
internal static extern JavaScriptErrorCode JsGetPropertyIdFromSymbol(JavaScriptValue symbol, out JavaScriptPropertyId propertyId);
internal static extern JavaScriptErrorCode JsCreateSymbol(JavaScriptValue description, out JavaScriptValue symbol);
internal static extern JavaScriptErrorCode JsGetOwnPropertySymbols(JavaScriptValue obj, out JavaScriptValue propertySymbols);
internal static extern JavaScriptErrorCode JsGetPropertyIdFromSymbol(JavaScriptValue symbol, out JavaScriptPropertyId propertyId);
internal static extern JavaScriptErrorCode JsNumberToInt(JavaScriptValue value, out int intValue);
internal static extern JavaScriptErrorCode JsNumberToInt(JavaScriptValue value, out int intValue);
internal static extern JavaScriptErrorCode JsGetIndexedPropertiesExternalData(JavaScriptValue obj, IntPtr data, out JavaScriptTypedArrayType arrayType, out uint elementLength);
internal static extern JavaScriptErrorCode JsHasIndexedPropertiesExternalData(JavaScriptValue obj, out bool value);
internal static extern JavaScriptErrorCode JsHasIndexedPropertiesExternalData(JavaScriptValue obj, out bool value);
internal static extern JavaScriptErrorCode JsGetTypedArrayInfo(JavaScriptValue typedArray, out JavaScriptTypedArrayType arrayType, out JavaScriptValue arrayBuffer, out uint byteOffset, out uint byteLength);
internal static extern JavaScriptErrorCode JsInstanceOf(JavaScriptValue obj, JavaScriptValue constructor, out bool result);
internal static extern JavaScriptErrorCode JsRunSerializedScriptWithCallback(JavaScriptSerializedScriptLoadSourceCallback scriptLoadCallback, JavaScriptSerializedScriptUnloadCallback scriptUnloadCallback, byte[] buffer, JavaScriptSourceContext sourceContext, string sourceUrl, out JavaScriptValue result);
internal static extern JavaScriptErrorCode JsGetTypedArrayInfo(JavaScriptValue typedArray, out JavaScriptTypedArrayType arrayType, out JavaScriptValue arrayBuffer, out uint byteOffset, out uint byteLength);
/// <summary> /// Sets an object's property. /// </summary> /// <remarks> /// Requires an active script context. /// </remarks> /// <param name="id">The ID of the property.</param> /// <param name="value">The new value of the property.</param> /// <param name="useStrictRules">The property set should follow strict mode rules.</param> public void SetProperty(JavaScriptPropertyId id, JavaScriptValue value, bool useStrictRules) { Native.ThrowIfError(Native.JsSetProperty(this, id, value, useStrictRules)); }
internal static extern JavaScriptErrorCode JsGetContextOfObject(JavaScriptValue obj, out JavaScriptContext context);
/// <summary> /// Test if an object has a value at the specified index. /// </summary> /// <remarks> /// Requires an active script context. /// </remarks> /// <param name="index">The index to test.</param> /// <returns>Whether the object has an value at the specified index.</returns> public bool HasIndexedProperty(JavaScriptValue index) { bool hasProperty; Native.ThrowIfError(Native.JsHasIndexedProperty(this, index, out hasProperty)); return hasProperty; }
internal static extern JavaScriptErrorCode JsRunSerializedScriptWithCallback(JavaScriptSerializedScriptLoadSourceCallback scriptLoadCallback, JavaScriptSerializedScriptUnloadCallback scriptUnloadCallback, byte[] buffer, JavaScriptSourceContext sourceContext, string sourceUrl, out JavaScriptValue result);
/// <summary> /// Set the value at the specified index of an object. /// </summary> /// <remarks> /// Requires an active script context. /// </remarks> /// <param name="index">The index to set.</param> /// <param name="value">The value to set.</param> public void SetIndexedProperty(JavaScriptValue index, JavaScriptValue value) { Native.ThrowIfError(Native.JsSetIndexedProperty(this, index, value)); }
internal static extern JavaScriptErrorCode JsCreateURIError(JavaScriptValue message, out JavaScriptValue error);
/// <summary> /// Compare two JavaScript values for strict equality. /// </summary> /// <remarks> /// <para> /// This function is equivalent to the "===" operator in JavaScript. /// </para> /// <para> /// Requires an active script context. /// </para> /// </remarks> /// <param name="other">The object to compare.</param> /// <returns>Whether the values are strictly equal.</returns> public bool StrictEquals(JavaScriptValue other) { bool equals; Native.ThrowIfError(Native.JsStrictEquals(this, other, out equals)); return equals; }
internal static extern JavaScriptErrorCode JsDeleteIndexedProperty(JavaScriptValue obj, JavaScriptValue index);