Promise.prototype 属性表示 Promise 构造器的原型.
Promise.prototype 属性的属性特性: |
|
|---|---|
| writable | false |
| enumerable | false |
| configurable | false |
Promise 实例继承自 Promise.prototype. 你可以在构造器的原型对象添加属性或方法到所有 Promise 实例上.
Promise.prototype.constructorPromise 函数.Promise.prototype.catch(onRejected)Promise.prototype.then(onFulfilled, onRejected)Promise.prototype.finally(onFinally)| Specification | Status | Comment |
|---|---|---|
| ECMAScript 2015 (6th Edition, ECMA-262) Promise.prototype |
Standard | Initial definition. |
| Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
|---|---|---|---|---|---|
| Basic support | 32 | 24.0 (24.0) as Future25.0 (25.0) as Promise behind a flag[1]29.0 (29.0) by default |
未实现 | 19 | 7.1 |
| Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
|---|---|---|---|---|---|---|
| Basic support | 未实现 | 24.0 (24.0) as Future25.0 (25.0) as Promise behind a flag[1]29.0 (29.0) by default |
未实现 | 未实现 | iOS 8 | 32 |
[1] Gecko 24 has an experimental implementation of Promise, under the initial name of Future. It got renamed to its final name in Gecko 25, but disabled by default behind the flag dom.promise.enabled. Bug 918806 enabled Promises by default in Gecko 29.