-
Notifications
You must be signed in to change notification settings - Fork 225
Open
Description
Thanks to #79 this supports Electron already (an environment where we are both in a "browser" and in "node").
It might be good to do the same logic here, so that fs
is used when possible rather than synchronous XHR (which is deprecated anyways):
node-source-map-support/source-map-support.js
Lines 63 to 76 in 70c54a8
if (isInBrowser()) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', path, false); | |
xhr.send(null); | |
var contents = null | |
if (xhr.readyState === 4 && xhr.status === 200) { | |
contents = xhr.responseText | |
} | |
} | |
// Otherwise, use the filesystem | |
else { | |
var contents = fs.readFileSync(path, 'utf8'); | |
} |
Metadata
Metadata
Assignees
Labels
No labels