parent
90e0ce97e4
commit
62a331a3dc
|
@ -567,7 +567,7 @@
|
|||
|
||||
Lexer.prototype.unfinished = function() {
|
||||
var _ref3;
|
||||
return LINE_CONTINUER.test(this.chunk) || ((_ref3 = this.tag()) === '\\' || _ref3 === '.' || _ref3 === '?.' || _ref3 === 'UNARY' || _ref3 === 'MATH' || _ref3 === '+' || _ref3 === '-' || _ref3 === 'SHIFT' || _ref3 === 'RELATION' || _ref3 === 'COMPARE' || _ref3 === 'LOGIC' || _ref3 === 'COMPOUND_ASSIGN' || _ref3 === 'THROW' || _ref3 === 'EXTENDS');
|
||||
return LINE_CONTINUER.test(this.chunk) || ((_ref3 = this.tag()) === '\\' || _ref3 === '.' || _ref3 === '?.' || _ref3 === 'UNARY' || _ref3 === 'MATH' || _ref3 === '+' || _ref3 === '-' || _ref3 === 'SHIFT' || _ref3 === 'RELATION' || _ref3 === 'COMPARE' || _ref3 === 'LOGIC' || _ref3 === 'THROW' || _ref3 === 'EXTENDS');
|
||||
};
|
||||
|
||||
Lexer.prototype.escapeLines = function(str, heredoc) {
|
||||
|
|
|
@ -515,7 +515,7 @@ exports.Lexer = class Lexer
|
|||
unfinished: ->
|
||||
LINE_CONTINUER.test(@chunk) or
|
||||
@tag() in ['\\', '.', '?.', 'UNARY', 'MATH', '+', '-', 'SHIFT', 'RELATION'
|
||||
'COMPARE', 'LOGIC', 'COMPOUND_ASSIGN', 'THROW', 'EXTENDS']
|
||||
'COMPARE', 'LOGIC', 'THROW', 'EXTENDS']
|
||||
|
||||
# Converts newlines for string literals.
|
||||
escapeLines: (str, heredoc) ->
|
||||
|
|
|
@ -251,3 +251,22 @@ test "#1871: Special case for IMPLICIT_END in the middle of an implicit object",
|
|||
two: 2 for i in [1..3]
|
||||
|
||||
eq result.two.join(' '), '2 2 2'
|
||||
|
||||
test "#1961, #1974, regression with compound assigning to an implicit object", ->
|
||||
|
||||
obj = null
|
||||
|
||||
obj ?=
|
||||
one: 1
|
||||
two: 2
|
||||
|
||||
eq obj.two, 2
|
||||
|
||||
obj = null
|
||||
|
||||
obj or=
|
||||
three: 3
|
||||
four: 4
|
||||
|
||||
eq obj.four, 4
|
||||
|
Loading…
Reference in New Issue