This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Wrapper for built-in http.js to emulate the browser XMLHttpRequest object. | |
* | |
* This can be used with JS designed for browsers to improve reuse of code and | |
* allow the use of existing libraries. | |
* | |
* Usage: include("XMLHttpRequest.js") and use XMLHttpRequest per W3C specs. | |
* | |
* @author Dan DeFelippi <dan@driverdan.com> | |
* @contributor David Ellis <d.f.ellis@ieee.org> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let OriginalPromise = Promise; | |
var unfulfilledPromises = new Set(); | |
function TrackedPromise(fn) { | |
function resolve(value) { | |
unfulfilledPromises.delete(promise); | |
return trackedResolve(value); | |
} | |
function reject(err) { |