JSPromise<T extends JSAny?> extension type

A JavaScript Promise or a promise-like object.

Because JSPromise is an extension type, T is only a static guarantee and the JSPromise may not actually resolve to a T. Like with JSArray, we only check that this is a JSPromiseRepType.

Also like with JSArray, T may introduce additional checking elsewhere. When converted to a Future<T>, there is a cast to ensure that the Future actually resolves to a T to ensure soundness.

on
  • JSPromiseRepType
Implemented types
Annotations
  • @JS('Promise')

Constructors

JSPromise(JSFunction executor)

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited