Package org.htmlunit.corejs.javascript
Class NativePromise
- java.lang.Object
-
- org.htmlunit.corejs.javascript.ScriptableObject
-
- org.htmlunit.corejs.javascript.NativePromise
-
- All Implemented Interfaces:
java.io.Serializable,ConstProperties,DebuggableObject,Scriptable,SymbolScriptable
public class NativePromise extends ScriptableObject
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classNativePromise.Capabilityprivate static classNativePromise.PromiseAllResolverprivate static classNativePromise.PromiseElementResolverprivate static classNativePromise.Reaction(package private) static classNativePromise.ReactionTypeprivate static classNativePromise.ResolvingFunctions(package private) static classNativePromise.State-
Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject
ScriptableObject.KeyComparator
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.ArrayList<NativePromise.Reaction>fulfillReactionsprivate booleanhandledprivate java.util.ArrayList<NativePromise.Reaction>rejectReactionsprivate java.lang.Objectresultprivate NativePromise.Statestate-
Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
-
Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
-
-
Constructor Summary
Constructors Constructor Description NativePromise()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.Objectall(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)private static java.lang.ObjectallSettled(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)private voidcallThenable(Context cx, Scriptable scope, java.lang.Object resolution, Callable thenFunc)private static Scriptableconstructor(Context cx, Scriptable scope, java.lang.Object[] args)private static java.lang.ObjectdoAll(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args, boolean failFast)private static java.lang.ObjectdoCatch(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)private static java.lang.ObjectdoFinally(Context cx, Scriptable scope, Scriptable thisObj, LambdaConstructor defaultConstructor, java.lang.Object[] args)private java.lang.ObjectfulfillPromise(Context cx, Scriptable scope, java.lang.Object value)java.lang.StringgetClassName()Return the name of the class.private static java.lang.ObjectgetErrorObject(Context cx, Scriptable scope, RhinoException re)(package private) java.lang.ObjectgetResult()static voidinit(Context cx, Scriptable scope, boolean sealed)private static CallablemakeCatchFinally(Scriptable scope, java.lang.Object constructor, Callable onFinally)private static CallablemakeThenFinally(Scriptable scope, java.lang.Object constructor, Callable onFinally)private static java.lang.ObjectperformRace(Context cx, Scriptable scope, IteratorLikeIterable.Itr iterator, Scriptable thisObj, NativePromise.Capability cap)private static java.lang.Objectrace(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)private static java.lang.Objectreject(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)private java.lang.ObjectrejectPromise(Context cx, Scriptable scope, java.lang.Object reason)private static java.lang.Objectresolve(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)private static java.lang.ObjectresolveInternal(Context cx, Scriptable scope, java.lang.Object constructor, java.lang.Object arg)private java.lang.Objectthen(Context cx, Scriptable scope, LambdaConstructor defaultConstructor, java.lang.Object[] args)-
Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject
addLazilyInitializedValue, applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildClassCtor, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, checkValidAttributes, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getBase, getBase, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getIds, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, has, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, put, putConst, putConstProperty, putImpl, putProperty, putProperty, putProperty, querySlot, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size
-
-
-
-
Field Detail
-
state
private NativePromise.State state
-
result
private java.lang.Object result
-
handled
private boolean handled
-
fulfillReactions
private java.util.ArrayList<NativePromise.Reaction> fulfillReactions
-
rejectReactions
private java.util.ArrayList<NativePromise.Reaction> rejectReactions
-
-
Method Detail
-
init
public static void init(Context cx, Scriptable scope, boolean sealed)
-
constructor
private static Scriptable constructor(Context cx, Scriptable scope, java.lang.Object[] args)
-
getClassName
public java.lang.String getClassName()
Description copied from class:ScriptableObjectReturn the name of the class.This is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.
- Specified by:
getClassNamein interfaceScriptable- Specified by:
getClassNamein classScriptableObject
-
getResult
java.lang.Object getResult()
-
resolve
private static java.lang.Object resolve(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
-
resolveInternal
private static java.lang.Object resolveInternal(Context cx, Scriptable scope, java.lang.Object constructor, java.lang.Object arg)
-
reject
private static java.lang.Object reject(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
-
doAll
private static java.lang.Object doAll(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args, boolean failFast)
-
all
private static java.lang.Object all(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
-
allSettled
private static java.lang.Object allSettled(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
-
race
private static java.lang.Object race(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
-
performRace
private static java.lang.Object performRace(Context cx, Scriptable scope, IteratorLikeIterable.Itr iterator, Scriptable thisObj, NativePromise.Capability cap)
-
then
private java.lang.Object then(Context cx, Scriptable scope, LambdaConstructor defaultConstructor, java.lang.Object[] args)
-
doCatch
private static java.lang.Object doCatch(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
-
doFinally
private static java.lang.Object doFinally(Context cx, Scriptable scope, Scriptable thisObj, LambdaConstructor defaultConstructor, java.lang.Object[] args)
-
makeThenFinally
private static Callable makeThenFinally(Scriptable scope, java.lang.Object constructor, Callable onFinally)
-
makeCatchFinally
private static Callable makeCatchFinally(Scriptable scope, java.lang.Object constructor, Callable onFinally)
-
fulfillPromise
private java.lang.Object fulfillPromise(Context cx, Scriptable scope, java.lang.Object value)
-
rejectPromise
private java.lang.Object rejectPromise(Context cx, Scriptable scope, java.lang.Object reason)
-
callThenable
private void callThenable(Context cx, Scriptable scope, java.lang.Object resolution, Callable thenFunc)
-
getErrorObject
private static java.lang.Object getErrorObject(Context cx, Scriptable scope, RhinoException re)
-
-