IJsHostObjectHandler<TValue> Interface

The internal methods of a host exotic object created by IJsAdapter<TValue>.CreatePlatformObject (the legacy platform objects, https://webidl.spec.whatwg.org/#es-legacy-platform-objects). Each method returns true when it handled the operation; otherwise the adapter performs the ordinary internal method.

public interface IJsHostObjectHandler<TValue> where TValue : class

Type parameters

TValue

Methods

NameDescription
GetOwnKeys(TValue)[[OwnPropertyKeys]]: the keys that precede the ordinary keys, or null.
TryDefineOwnProperty(TValue, TValue, JsPropertyDescriptor<TValue>, bool)[[DefineOwnProperty]]. Sets result to the result of the operation.
TryDelete(TValue, TValue, bool)[[Delete]]. Sets result to the result of the operation.
TryGetOwnProperty(TValue, TValue, JsPropertyDescriptor<TValue>)[[GetOwnProperty]].
TrySet(TValue, TValue, TValue, bool)[[Set]] when the receiver is the object. Sets result to the result of the operation.
TrySet(TValue, TValue, TValue, TValue, bool)[[Set]] when the receiver is another object (an object whose prototype chain contains the object). Sets result to the result of the operation.

GetOwnKeys(TValue)

[[OwnPropertyKeys]]: the keys that precede the ordinary keys, or null.

IReadOnlyList<TValue>? GetOwnKeys(TValue obj)

Parameters

obj TValue

Returns

IReadOnlyList<TValue>?

TryDefineOwnProperty(TValue, TValue, JsPropertyDescriptor<TValue>, bool)

[[DefineOwnProperty]]. Sets result to the result of the operation.

bool TryDefineOwnProperty(TValue obj, TValue key, in JsPropertyDescriptor<TValue> descriptor, out bool result)

Parameters

obj TValue
key TValue
descriptor JsPropertyDescriptor<TValue>
result bool

Returns

bool

TryDelete(TValue, TValue, bool)

[[Delete]]. Sets result to the result of the operation.

bool TryDelete(TValue obj, TValue key, out bool result)

Parameters

obj TValue
key TValue
result bool

Returns

bool

TryGetOwnProperty(TValue, TValue, JsPropertyDescriptor<TValue>)

[[GetOwnProperty]].

bool TryGetOwnProperty(TValue obj, TValue key, out JsPropertyDescriptor<TValue> descriptor)

Parameters

obj TValue
key TValue
descriptor JsPropertyDescriptor<TValue>

Returns

bool

TrySet overloads

TrySet(TValue, TValue, TValue, bool)

[[Set]] when the receiver is the object. Sets result to the result of the operation.

bool TrySet(TValue obj, TValue key, TValue value, out bool result)
Parameters
obj TValue
key TValue
value TValue
result bool
Returns

bool

TrySet(TValue, TValue, TValue, TValue, bool)

[[Set]] when the receiver is another object (an object whose prototype chain contains the object). Sets result to the result of the operation.

bool TrySet(TValue obj, TValue key, TValue value, TValue receiver, out bool result)
Parameters
obj TValue
key TValue
value TValue
receiver TValue
result bool
Returns

bool