Fix single-line heredocs starting with "undefined"
This commit is contained in:
parent
dc8a2b17d0
commit
4503e2716e
|
@ -242,7 +242,9 @@
|
|||
if (i === $) {
|
||||
value = value.replace(TRAILING_BLANK_LINE, '');
|
||||
}
|
||||
value = value.replace(indentRegex, '');
|
||||
if (indentRegex) {
|
||||
value = value.replace(indentRegex, '');
|
||||
}
|
||||
return value;
|
||||
};
|
||||
})(this));
|
||||
|
|
|
@ -217,7 +217,7 @@ exports.Lexer = class Lexer
|
|||
value = @formatString value
|
||||
value = value.replace LEADING_BLANK_LINE, '' if i is 0
|
||||
value = value.replace TRAILING_BLANK_LINE, '' if i is $
|
||||
value = value.replace indentRegex, ''
|
||||
value = value.replace indentRegex, '' if indentRegex
|
||||
value
|
||||
else
|
||||
@mergeInterpolationTokens tokens, {delimiter}, (value, i) =>
|
||||
|
|
|
@ -342,6 +342,9 @@ eq """ "\\\" """, ' "\\" '
|
|||
|
||||
eq ''' <- keep these spaces -> ''', ' <- keep these spaces -> '
|
||||
|
||||
eq '''undefined''', 'undefined'
|
||||
eq """undefined""", 'undefined'
|
||||
|
||||
|
||||
test "#1046, empty string interpolations", ->
|
||||
eq "#{ }", ''
|
||||
|
|
Loading…
Reference in New Issue