Package org.mozilla.javascript
Class NativePromise
java.lang.Object
org.mozilla.javascript.ScriptableObject
org.mozilla.javascript.NativePromise
- All Implemented Interfaces:
Serializable
,ConstProperties
,DebuggableObject
,Scriptable
,SymbolScriptable
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
private static class
private static class
private static class
(package private) static enum
private static class
(package private) static enum
Nested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObject
ScriptableObject.KeyComparator
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ArrayList<NativePromise.Reaction>
private boolean
private ArrayList<NativePromise.Reaction>
private Object
private NativePromise.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 -
Method Summary
Modifier and TypeMethodDescriptionprivate static Object
all
(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) private void
callThenable
(Context cx, Scriptable scope, Object resolution, Callable thenFunc) private static Scriptable
constructor
(Context cx, Scriptable scope, Object[] args) private static Object
doCatch
(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) private static Object
doFinally
(Context cx, Scriptable scope, Scriptable thisObj, LambdaConstructor defaultConstructor, Object[] args) private Object
fulfillPromise
(Context cx, Scriptable scope, Object value) Return the name of the class.private static Object
getErrorObject
(Context cx, Scriptable scope, RhinoException re) (package private) Object
static void
init
(Context cx, Scriptable scope, boolean sealed) private static Callable
makeCatchFinally
(Scriptable scope, Object constructor, Callable onFinally) private static Callable
makeThenFinally
(Scriptable scope, Object constructor, Callable onFinally) private static Object
performRace
(Context cx, Scriptable scope, IteratorLikeIterable.Itr iterator, Scriptable thisObj, NativePromise.Capability cap) private static Object
race
(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) private static Object
reject
(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) private Object
rejectPromise
(Context cx, Scriptable scope, Object reason) private static Object
resolve
(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) private static Object
resolveInternal
(Context cx, Scriptable scope, Object constructor, Object arg) private Object
then
(Context cx, Scriptable scope, LambdaConstructor defaultConstructor, 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 Details
-
state
-
result
-
handled
private boolean handled -
fulfillReactions
-
rejectReactions
-
-
Constructor Details
-
NativePromise
public NativePromise()
-
-
Method Details
-
init
-
constructor
-
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
Object getResult() -
resolve
-
resolveInternal
-
reject
-
all
-
race
-
performRace
private static Object performRace(Context cx, Scriptable scope, IteratorLikeIterable.Itr iterator, Scriptable thisObj, NativePromise.Capability cap) -
then
private Object then(Context cx, Scriptable scope, LambdaConstructor defaultConstructor, Object[] args) -
doCatch
-
doFinally
private static Object doFinally(Context cx, Scriptable scope, Scriptable thisObj, LambdaConstructor defaultConstructor, Object[] args) -
makeThenFinally
-
makeCatchFinally
-
fulfillPromise
-
rejectPromise
-
callThenable
-
getErrorObject
-