This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
From the example: xhr.onload = function() { if(xhr.response) resolver.resolve(xhr.response) resolve.reject(new DOMError("JSONError")) } xhr.onloadend = function() { resolver.reject(new DOMError("NetworkError")) } }) If "resolve" in line 4 is "resolver", I think I understand this. BTW: The idiom of "reject does nothing if resolver.resolve succeeded" wasn't obvious to me until the third reading; it might be reader-friendly to add a comment about this.
Thanks Harald! https://github.com/whatwg/dom/commit/97f7cb156b4b1d50f8759e2e1db1bf4f31841635