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 classprivate static classprivate static classprivate static class(package private) static enumprivate static class(package private) static enumNested classes/interfaces inherited from class org.mozilla.javascript.ScriptableObject
ScriptableObject.KeyComparator -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ArrayList<NativePromise.Reaction> private booleanprivate ArrayList<NativePromise.Reaction> private Objectprivate NativePromise.StateFields inherited from class org.mozilla.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONSTFields inherited from interface org.mozilla.javascript.Scriptable
NOT_FOUND -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static Objectall(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) private voidcallThenable(Context cx, Scriptable scope, Object resolution, Callable thenFunc) private static Scriptableconstructor(Context cx, Scriptable scope, Object[] args) private static ObjectdoCatch(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) private static ObjectdoFinally(Context cx, Scriptable scope, Scriptable thisObj, LambdaConstructor defaultConstructor, Object[] args) private ObjectfulfillPromise(Context cx, Scriptable scope, Object value) Return the name of the class.private static ObjectgetErrorObject(Context cx, Scriptable scope, RhinoException re) (package private) Objectstatic voidinit(Context cx, Scriptable scope, boolean sealed) private static CallablemakeCatchFinally(Scriptable scope, Object constructor, Callable onFinally) private static CallablemakeThenFinally(Scriptable scope, Object constructor, Callable onFinally) private static ObjectperformRace(Context cx, Scriptable scope, IteratorLikeIterable.Itr iterator, Scriptable thisObj, NativePromise.Capability cap) private static Objectrace(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) private static Objectreject(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) private ObjectrejectPromise(Context cx, Scriptable scope, Object reason) private static Objectresolve(Context cx, Scriptable scope, Scriptable thisObj, Object[] args) private static ObjectresolveInternal(Context cx, Scriptable scope, Object constructor, Object arg) private Objectthen(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: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
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
-