JsJobCallback Struct

A JobCallback Record (https://tc39.es/ecma262/#sec-jobcallback-records): a function and the host-defined state captured when it was registered.

public readonly struct JsJobCallback : IEquatable<JsJobCallback>
Implements

Constructors

NameDescription
JsJobCallback(JsObject, object?)Creates a JobCallback Record.

JsJobCallback(JsObject, object?)

JsJob.cs

Creates a JobCallback Record.

public JsJobCallback(JsObject callback, object? hostDefined)

Parameters

callback JsObject
hostDefined object?

Properties

NameDescription
CallbackGets the function ([[Callback]]).
HostDefinedGets the [[HostDefined]] value, captured by JsHost.MakeJobCallback.

Callback

JsJob.cs

Gets the function ([[Callback]]).

public JsObject Callback { get; }

Property value

JsObject

HostDefined

JsJob.cs

Gets the [[HostDefined]] value, captured by JsHost.MakeJobCallback.

public object? HostDefined { get; }

Property value

object?

Methods

NameDescription
Equals(JsJobCallback)Indicates whether the current object is equal to another object of the same type.
Equals(object?)Indicates whether this instance and a specified object are equal.
GetHashCode()Returns the hash code for this instance.

Equals overloads

Equals(JsJobCallback)

JsJob.cs

Indicates whether the current object is equal to another object of the same type.

public bool Equals(JsJobCallback other)
Parameters
other JsJobCallback
An object to compare with this object.
Returns

bool true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

JsJob.cs

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)
Parameters
obj object?
The object to compare with the current instance.
Returns

bool true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

JsJob.cs

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int A 32-bit signed integer that is the hash code for this instance.

Operators

NameDescription
operator ==(JsJobCallback, JsJobCallback)Compares two records.
operator !=(JsJobCallback, JsJobCallback)Compares two records.

operator ==(JsJobCallback, JsJobCallback)

JsJob.cs

Compares two records.

public static bool operator ==(JsJobCallback left, JsJobCallback right)

Parameters

left JsJobCallback
right JsJobCallback

Returns

bool

operator !=(JsJobCallback, JsJobCallback)

JsJob.cs

Compares two records.

public static bool operator !=(JsJobCallback left, JsJobCallback right)

Parameters

left JsJobCallback
right JsJobCallback

Returns

bool