Invokes the appropriate callback function as soon as a promised {@code value} is resolved. This function is similar to {@code webdriver.promise.when}, except it does not return a new promise.
The value to observe.
The function to call when the value is resolved successfully.
The function to call when the value is rejected.
Wraps a function that is assumed to be a node-style callback as its final argument. This callback takes two arguments: an error value (which will be null if the call succeeded), and the success value as the second argument. If the call fails, the returned promise will be rejected, otherwise it will be resolved with the result.
The function to wrap.
A promise that will be resolved with the result of the provided function's callback.
The currently active control flow.
Creates a new control flow. The provided callback will be invoked as the first task within the new flow, with the flow as its sole argument. Returns a promise that resolves to the callback result.
The entry point to the newly created flow.
A promise that resolves to the callback result.
Creates a new deferred object.
Function to call when cancelling the computation of this instance's value.
The new deferred object.
Creates a promise that will be resolved at a set time in the future.
The amount of time, in milliseconds, to wait before resolving the promise.
The promise.
Creates a promise that has been resolved with the given value.
The resolved value.
The resolved promise.
Returns a promise that will be resolved with the input value in a fully-resolved state. If the value is an array, each element will be fully resolved. Likewise, if the value is an object, all keys will be fully resolved. In both cases, all nested arrays and objects will also be fully resolved. All fields are resolved in place; the returned promise will resolve on {@code value} and not a copy.
Warning: This function makes no checks against objects that contain cyclical references:
var value = {}; value['self'] = value; webdriver.promise.fullyResolved(value); // Stack overflow.
The value to fully resolve.
A promise for a fully resolved version of the input value.
Determines whether a {@code value} should be treated as a promise. Any object whose "then" property is a function will be considered a promise.
The value to test.
boolean
Whether the value is a promise.
Creates a promise that has been rejected with the given reason.
The rejection reason; may be any value, but is usually an Error or a string.
The rejected promise.
Changes the default flow to use when no others are active.
The new default flow.
Registers an observer on a promised {@code value}, returning a new promise that will be resolved when the value is. If {@code value} is not a promise, then the return promise will be immediately resolved.
The value to observe.
The function to call when the value is resolved successfully.
The function to call when the value is rejected.
A new promise.