public class Promise extends SimpleScriptable
Promise.| Constructor and Description |
|---|
Promise()
Default constructor.
|
Promise(Object object)
Constructor new promise with the given
object. |
Promise(Window window)
Facility constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static Promise |
all(net.sourceforge.htmlunit.corejs.javascript.Context context,
net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
net.sourceforge.htmlunit.corejs.javascript.Function function)
Returns a
Promise that resolves when all of the promises in the iterable argument have resolved,
or rejects with the reason of the first passed promise that rejects. |
Promise |
catch_js(net.sourceforge.htmlunit.corejs.javascript.Function onRejected)
Returns a Promise and deals with rejected cases only.
|
static Promise |
reject(net.sourceforge.htmlunit.corejs.javascript.Context context,
net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
net.sourceforge.htmlunit.corejs.javascript.Function function)
Returns a
Promise object that is rejected with the given value. |
static Promise |
resolve(net.sourceforge.htmlunit.corejs.javascript.Context context,
net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
net.sourceforge.htmlunit.corejs.javascript.Function function)
Returns a
Promise object that is resolved with the given value. |
Promise |
then(net.sourceforge.htmlunit.corejs.javascript.Function onFulfilled,
net.sourceforge.htmlunit.corejs.javascript.Function onRejected)
It takes two arguments, both are callback functions for the success and failure cases of the Promise.
|
clone, equivalentValues, get, getBrowserVersion, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getWindow, getWindow, getWithPreemption, has, hasInstance, initParentScope, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElementdefineFunctionProperties, defineProperty, getClassName, setClassName, setParentScopeapplyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setPrototype, sizepublic Promise()
public Promise(Window window)
window - the owning windowpublic Promise(Object object)
object.object - the objectpublic static Promise resolve(net.sourceforge.htmlunit.corejs.javascript.Context context, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, net.sourceforge.htmlunit.corejs.javascript.Function function)
Promise object that is resolved with the given value.context - the contextthisObj - this objectargs - the argumentsfunction - the functionPromisepublic static Promise reject(net.sourceforge.htmlunit.corejs.javascript.Context context, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, net.sourceforge.htmlunit.corejs.javascript.Function function)
Promise object that is rejected with the given value.context - the contextthisObj - this objectargs - the argumentsfunction - the functionPromisepublic static Promise all(net.sourceforge.htmlunit.corejs.javascript.Context context, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, net.sourceforge.htmlunit.corejs.javascript.Function function)
Promise that resolves when all of the promises in the iterable argument have resolved,
or rejects with the reason of the first passed promise that rejects.context - the contextthisObj - this objectargs - the argumentsfunction - the functionPromisepublic Promise then(net.sourceforge.htmlunit.corejs.javascript.Function onFulfilled, net.sourceforge.htmlunit.corejs.javascript.Function onRejected)
onFulfilled - success functiononRejected - failure functionPromiseCopyright © 2002–2016 Gargoyle Software Inc.. All rights reserved.