Update reader.

This commit is contained in:
Bruce
2026-04-04 19:27:45 +08:00
parent f9f4db3f6c
commit bf54d5a531
22 changed files with 3405 additions and 21 deletions

View File

@@ -502,6 +502,22 @@
if (!p.removeEventListener) p.removeEventListener = PromisePolyfill.removeEventListener;
if (!p.dispatchEvent) p.dispatchEvent = PromisePolyfill.dispatchEvent;
if (!p.onerror) p.onerror = null;
if (typeof p.prototype.then !== "function") {
p.prototype.then = function(onFulfilled, onRejected) {
return new p(function(resolve, reject) {
this.then(resolve, reject);
}).then(onFulfilled, onRejected);
};
}
if (typeof p.prototype.done !== "function") {
p.prototype.done = function(onFulfilled, onRejected) {
this.then(onFulfilled, onRejected)["catch"](function(ex) {
setTimeout(function() {
throw ex;
}, 0);
});
};
}
}
if (typeof global.WinJS !== "undefined" && typeof global.WinJS.Promise !== "undefined") {
var wp = global.WinJS.Promise;