Package org.mozilla.javascript
Class NativePromise
- java.lang.Object
-
- org.mozilla.javascript.ScriptableObject
-
- org.mozilla.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 class
NativePromise.Capability
private static class
NativePromise.PromiseAllResolver
private static class
NativePromise.PromiseElementResolver
private static class
NativePromise.Reaction
(package private) static class
NativePromise.ReactionType
private static class
NativePromise.ResolvingFunctions
(package private) static class
NativePromise.State
-
Nested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObject
ScriptableObject.KeyComparator
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.ArrayList<NativePromise.Reaction>
fulfillReactions
private boolean
handled
private java.util.ArrayList<NativePromise.Reaction>
rejectReactions
private java.lang.Object
result
private NativePromise.State
state
-
Fields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
-
Fields inherited from interface org.mozilla.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.Object
all(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
private void
callThenable(Context cx, Scriptable scope, java.lang.Object resolution, Callable thenFunc)
private static Scriptable
constructor(Context cx, Scriptable scope, java.lang.Object[] args)
private static java.lang.Object
doCatch(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
private static java.lang.Object
doFinally(Context cx, Scriptable scope, Scriptable thisObj, LambdaConstructor defaultConstructor, java.lang.Object[] args)
private java.lang.Object
fulfillPromise(Context cx, Scriptable scope, java.lang.Object value)
java.lang.String
getClassName()
Return the name of the class.private static java.lang.Object
getErrorObject(Context cx, Scriptable scope, RhinoException re)
(package private) java.lang.Object
getResult()
static void
init(Context cx, Scriptable scope, boolean sealed)
private static Callable
makeCatchFinally(Scriptable scope, java.lang.Object constructor, Callable onFinally)
private static Callable
makeThenFinally(Scriptable scope, java.lang.Object constructor, Callable onFinally)
private static java.lang.Object
performRace(Context cx, Scriptable scope, IteratorLikeIterable.Itr iterator, Scriptable thisObj, NativePromise.Capability cap)
private static java.lang.Object
race(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
private static java.lang.Object
reject(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
private java.lang.Object
rejectPromise(Context cx, Scriptable scope, java.lang.Object reason)
private static java.lang.Object
resolve(Context cx, Scriptable scope, Scriptable thisObj, java.lang.Object[] args)
private static java.lang.Object
resolveInternal(Context cx, Scriptable scope, java.lang.Object constructor, java.lang.Object arg)
private java.lang.Object
then(Context cx, Scriptable scope, LambdaConstructor defaultConstructor, java.lang.Object[] args)
-
Methods inherited from class org.mozilla.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, delete, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, 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, 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:ScriptableObject
Return the name of the class.This is typically the same name as the constructor. Classes extending ScriptableObject must implement this abstract method.
- Specified by:
getClassName
in interfaceScriptable
- Specified by:
getClassName
in 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)
-
all
private static java.lang.Object all(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)
-
-