java.lang.Object
org.htmlunit.corejs.javascript.SlotMapOwner<org.htmlunit.corejs.javascript.Scriptable>
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.javascript.HtmlUnitScriptable
org.htmlunit.javascript.host.event.EventTarget
org.htmlunit.javascript.host.abort.AbortSignal
- All Implemented Interfaces:
Serializable,Cloneable,org.htmlunit.corejs.javascript.ConstProperties<org.htmlunit.corejs.javascript.Scriptable>,org.htmlunit.corejs.javascript.debug.DebuggableObject,org.htmlunit.corejs.javascript.PropHolder<org.htmlunit.corejs.javascript.Scriptable>,org.htmlunit.corejs.javascript.Scriptable,org.htmlunit.corejs.javascript.SymbolScriptable
The JavaScript object
AbortSignal.- Author:
- Ronald Brill
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.corejs.javascript.ScriptableObject.DescriptorInfo, org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator, org.htmlunit.corejs.javascript.ScriptableObject.LambdaGetterFunction, org.htmlunit.corejs.javascript.ScriptableObject.LambdaSetterFunction -
Field Summary
Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, LEGACY_CONST, PERMANENT, READONLY, STRICTLY_READONLY, UNINITIALIZED_CONSTFields inherited from class org.htmlunit.corejs.javascript.SlotMapOwner
isSealedFields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAbortAlgorithm(Runnable algorithm) Adds an algorithm that is run when this signal is aborted.static AbortSignalany(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function funObj) Returns a signal that is aborted when any of the given signals is aborted.static AbortSignalcreateDependentSignal(HtmlUnitScriptable owner, List<AbortSignal> signals) INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Creates a signal that is aborted when any of the given signals is aborted (likeAbortSignal.any()); used e.g. for the signal of aRequest.org.htmlunit.corejs.javascript.FunctionReturns theonabortevent handler.Returns the abort reason (undefinedif not aborted).booleanReturns whether the signal is aborted.static AbortSignaljsAbort(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function funObj) Returns a signal that is already aborted.voidJavaScript constructor; like the browsers, anAbortSignalcan't be created by script.voidremoveAbortAlgorithm(Runnable algorithm) Removes an algorithm added byaddAbortAlgorithm(Runnable).voidsetOnabort(Object handler) Sets theonabortevent handler.voidsignalAbort(Object reason) Aborts this signal: sets the reason (anAbortErrorifundefined), runs the abort algorithms, fires the abort event and aborts the dependent signals.voidThrows the abort reason if the signal is aborted.static AbortSignaltimeout(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function funObj) Returns a signal that is aborted with aTimeoutErrorafter the given time.Methods inherited from class org.htmlunit.javascript.host.event.EventTarget
addEventListener, clearEventListenersContainer, dispatchEvent, executeEventLocally, fireEvent, getEventHandler, getEventListenersContainer, hasEventHandlers, isEventHandlerOnWindow, removeAllEventListeners, removeEventListener, setEventHandlerMethods inherited from class org.htmlunit.javascript.HtmlUnitScriptable
clone, createDOMException, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getIds, getIndexedPropertyCount, getOwnPropertyDescriptor, getPrototype, getScriptableFor, getWindow, getWindow, getWindowOrWorkerGlobalScope, getWithPreemption, has, hasInstance, isIndexedPropertyWritable, makeScriptableFor, put, setClassName, setDomNode, setDomNode, setupPromise, setupRejectedPromiseMethods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkNotSealed, checkPropertyChangeForSlot, checkPropertyChangeForSlot, checkPropertyDefinition, checkPropertyDefinition, checkSlotRemoval, defineBuiltinProperty, defineBuiltinProperty, defineBuiltInProperty, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, ensureType, get, get, getAllIds, getAncestor, getArrayPrototype, getClassPrototype, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getObjectPrototype, getParentScope, getProperty, getProperty, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getThis, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, hasProperty, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGenericDescriptor, isGetterOrSetter, isGetterOrSetter, isTrue, preventExtensions, put, put, putConst, putConstProperty, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, redefineProperty, sameValue, sealObject, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, sizeMethods inherited from class org.htmlunit.corejs.javascript.SlotMapOwner
associateValue, checkNotSealed, copyAssociatedValue, createSlotMap, createSlotMap, defineProperty, defineProperty, get, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getIds, has, has, isSealed, readMaps, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, writeMapsMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.htmlunit.corejs.javascript.Scriptable
get, getIds, has, hasMethods inherited from interface org.htmlunit.corejs.javascript.SymbolScriptable
get, has
-
Constructor Details
-
AbortSignal
public AbortSignal()
-
-
Method Details
-
jsConstructor
public void jsConstructor()JavaScript constructor; like the browsers, anAbortSignalcan't be created by script.- Overrides:
jsConstructorin classEventTarget
-
isAborted
public boolean isAborted()Returns whether the signal is aborted.- Returns:
- whether the signal is aborted
-
getReason
Returns the abort reason (undefinedif not aborted).- Returns:
- the abort reason
-
throwIfAborted
public void throwIfAborted()Throws the abort reason if the signal is aborted. -
getOnabort
public org.htmlunit.corejs.javascript.Function getOnabort()Returns theonabortevent handler.- Returns:
- the handler
-
setOnabort
Sets theonabortevent handler.- Parameters:
handler- the handler
-
jsAbort
public static AbortSignal jsAbort(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function funObj) Returns a signal that is already aborted.- Parameters:
cx- the current contextscope- the scopethisObj- this objectargs- the arguments (the optional reason)funObj- the function- Returns:
- the aborted signal
-
timeout
public static AbortSignal timeout(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function funObj) Returns a signal that is aborted with aTimeoutErrorafter the given time.- Parameters:
cx- the current contextscope- the scopethisObj- this objectargs- the arguments (the time in milliseconds)funObj- the function- Returns:
- the signal
-
any
public static AbortSignal any(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, org.htmlunit.corejs.javascript.Function funObj) Returns a signal that is aborted when any of the given signals is aborted.- Parameters:
cx- the current contextscope- the scopethisObj- this objectargs- the arguments (the signals)funObj- the function- Returns:
- the signal
-
createDependentSignal
public static AbortSignal createDependentSignal(HtmlUnitScriptable owner, List<AbortSignal> signals) INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK.
Creates a signal that is aborted when any of the given signals is aborted (likeAbortSignal.any()); used e.g. for the signal of aRequest.- Parameters:
owner- the object used for the scope and the prototype of the new signalsignals- the signals- Returns:
- the new signal
- See Also:
-
addAbortAlgorithm
Adds an algorithm that is run when this signal is aborted.- Parameters:
algorithm- the algorithm
-
removeAbortAlgorithm
Removes an algorithm added byaddAbortAlgorithm(Runnable).- Parameters:
algorithm- the algorithm
-
signalAbort
Aborts this signal: sets the reason (anAbortErrorifundefined), runs the abort algorithms, fires the abort event and aborts the dependent signals.- Parameters:
reason- the reason- See Also:
-