mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
This commit is contained in:
commit
277e82bd03
3 changed files with 7 additions and 2 deletions
|
@ -478,7 +478,7 @@
|
|||
end = stack[stack.length - 1];
|
||||
continue;
|
||||
}
|
||||
if (end === '}' && (letter === '"' || letter === "'")) {
|
||||
if (end === '}' && (letter === '"' || letter === "'" || letter === '/')) {
|
||||
stack.push(end = letter);
|
||||
} else if (end === '}' && letter === '{') {
|
||||
stack.push(end = '}');
|
||||
|
|
|
@ -414,7 +414,7 @@ exports.Lexer = class Lexer
|
|||
return str.slice 0, i + 1
|
||||
end = stack[stack.length - 1]
|
||||
continue
|
||||
if end is '}' and letter in ['"', "'"]
|
||||
if end is '}' and letter in ['"', "'", '/']
|
||||
stack.push end = letter
|
||||
else if end is '}' and letter is '{'
|
||||
stack.push end = '}'
|
||||
|
|
|
@ -20,6 +20,11 @@ eq "#{ "{" }", "{"
|
|||
eq "#{ '#{}}' } }", '#{}} }'
|
||||
eq "#{"'#{ ({a: "b#{1}"}['a']) }'"}", "'b1'"
|
||||
|
||||
# Issue 1150: String interpolation regression
|
||||
eq "#{/'/.test ''}", 'false'
|
||||
eq "#{"'/" + '/"' + /"'/.test ''}", '\'//"false'
|
||||
eq "#{"'/"}#{'/"'}#{/"'/.test ''}", '\'//"false'
|
||||
|
||||
hello = 'Hello'
|
||||
world = 'World'
|
||||
ok '#{hello} #{world}!' is '#{hello} #{world}!'
|
||||
|
|
Loading…
Reference in a new issue