Skip to content

Commit 00fb735

Browse files
committed
Release v3.0.2
1 parent ff89ebb commit 00fb735

File tree

5 files changed

+20
-14
lines changed

5 files changed

+20
-14
lines changed

dist/stacktrace-gps-with-polyfills.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/stacktrace-gps-with-polyfills.min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/stacktrace-gps.js

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,9 +126,14 @@
126126
}
127127

128128
function _findSourceMappingURL(source) {
129-
var m = /\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/m.exec(source);
130-
if (m && m[1]) {
131-
return m[1];
129+
var sourceMappingUrlRegExp = /\/\/[#@] ?sourceMappingURL=([^\s'"]+)\s*$/mg;
130+
var lastSourceMappingUrl;
131+
var matchSourceMappingUrl;
132+
while (matchSourceMappingUrl = sourceMappingUrlRegExp.exec(source)) { // jshint ignore:line
133+
lastSourceMappingUrl = matchSourceMappingUrl[1];
134+
}
135+
if (lastSourceMappingUrl) {
136+
return lastSourceMappingUrl;
132137
} else {
133138
throw new Error('sourceMappingURL not found');
134139
}
@@ -222,8 +227,8 @@
222227
* Creating SourceMapConsumers is expensive, so this wraps the creation of a
223228
* SourceMapConsumer in a per-instance cache.
224229
*
225-
* @param sourceMappingURL = {String} URL to fetch source map from
226-
* @param defaultSourceRoot = Default source root for source map if undefined
230+
* @param {String} sourceMappingURL = URL to fetch source map from
231+
* @param {String} defaultSourceRoot = Default source root for source map if undefined
227232
* @returns {Promise} that resolves a SourceMapConsumer
228233
*/
229234
this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {
@@ -321,12 +326,13 @@
321326
sourceMappingURL = defaultSourceRoot + sourceMappingURL;
322327
}
323328

324-
return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot).then(function(sourceMapConsumer) {
325-
return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache)
326-
.then(resolve)['catch'](function() {
327-
resolve(stackframe);
329+
return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot)
330+
.then(function(sourceMapConsumer) {
331+
return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache)
332+
.then(resolve)['catch'](function() {
333+
resolve(stackframe);
334+
});
328335
});
329-
});
330336
}.bind(this), reject)['catch'](reject);
331337
}.bind(this));
332338
};

0 commit comments

Comments
 (0)