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 |
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, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement
defineFunctionProperties, defineProperty, getClassName, setClassName, setParentScope
applyDescriptorToAttributeBitset, 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, 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, size
public 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 functionPromise
public Promise then(net.sourceforge.htmlunit.corejs.javascript.Function onFulfilled, net.sourceforge.htmlunit.corejs.javascript.Function onRejected)
onFulfilled
- success functiononRejected
- failure functionPromise
Copyright © 2002–2016 Gargoyle Software Inc.. All rights reserved.