8000 Support resolving files with the file:// protocol · stacktracejs/stacktrace-gps@6fd0396 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6fd0396

Browse files
committed
Support resolving files with the file:// protocol
Issue: #40
1 parent e173aff commit 6fd0396

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

stacktrace-gps.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
req.onerror = reject;
2727
req.onreadystatechange = function onreadystatechange() {
2828
if (req.readyState === 4) {
29-
if (req.status >= 200 && req.status < 300) {
29+
if ((req.status >= 200 && req.status < 300) ||
30+
(url.substr(0, 7) === 'file://' && req.responseText)) {
3031
resolve(req.responseText);
3132
} else {
3233
reject(new Error('HTTP status: ' + req.status + ' retrieving ' + url));
@@ -134,7 +135,6 @@
134135
}
135136

136137

137-
138138
function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {
139139
return new Promise(function(resolve, reject) {
140140
var loc = sourceMapConsumer.originalPositionFor({

0 commit comments

Comments
 (0)
0