Skip to content

Commit 7dc54a1

Browse files
committed
Fix: "*" was being appended to sources too often
The while loop construction was actually yielding false positives due to the placement of parentheses, and would append an "*" to sources even when unnecessary.
1 parent d32f6e6 commit 7dc54a1

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/SourceMapDevToolPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ SourceMapDevToolPlugin.prototype.apply = function(compiler) {
4444
str = str.split("!");
4545
str = str.pop() + (str.length > 0 ? " " + str.join("!") : "");
4646
var idx;
47-
while((idx = sourceMap.sources.indexOf(str) >= 0) && (idx < i)) {
47+
while ((idx = sourceMap.sources.indexOf(str)) && (idx >= 0) && (idx < i)) {
4848
str += "*";
4949
}
5050
sourceMap.sources[i] = str;
@@ -80,4 +80,4 @@ SourceMapDevToolPlugin.prototype.apply = function(compiler) {
8080
function basename(name) {
8181
if(name.indexOf("/") < 0) return name;
8282
return name.substr(name.lastIndexOf("/")+1);
83-
}
83+
}

0 commit comments

Comments
 (0)