node-XMLHttpRequest
node-XMLHttpRequest copied to clipboard
XMLHttpRequest.DONE undefined
console.log(xhr.readyState + " " + XMLHttpRequest.DONE)
4 undefined
Just ran into this myself. Simple fix of shimming these five lines in somewhere into the codebase; or into your own project (as a workaround) after the line var XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest;
:
XMLHttpRequest.UNSENT = 0;
XMLHttpRequest.OPENED = 1;
XMLHttpRequest.HEADERS_RECEIVED = 2;
XMLHttpRequest.LOADING = 3;
XMLHttpRequest.DONE = 4;