Skip to content

Commit

Permalink
fixes for NewStringInJSLog
Browse files Browse the repository at this point in the history
  • Loading branch information
evanw committed Sep 30, 2022
1 parent aaae34e commit fdbea94
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -1769,7 +1769,7 @@ func NewStringInJSLog(log Log, outerTracker *LineColumnTracker, outerStringLiter

// Advance the outer loc, assuming the string syntax is already valid
c, width = utf8.DecodeRuneInString(outerContents[loc.Start:])
if c == '\r' && outerContents[loc.Start] == '\n' {
if c == '\r' && outerContents[loc.Start+1] == '\n' {
// Handle newlines on Windows in template literal strings
loc.Start += 2
} else if c != '\\' {
Expand Down Expand Up @@ -1800,7 +1800,7 @@ func NewStringInJSLog(log Log, outerTracker *LineColumnTracker, outerStringLiter
break

default:
loc.Start += int32(width)
loc.Start += 1 + int32(width)
}
}
}
Expand Down

0 comments on commit fdbea94

Please sign in to comment.