allow multiline comment inside of an object definition [Fixes #3761]
use more CoffeeScript syntax
This commit is contained in:
parent
68c0e2dc0f
commit
dc44ebbdaa
|
@ -301,6 +301,9 @@
|
|||
} else if (inImplicitObject() && !this.insideForDeclaration && sameLine && tag !== 'TERMINATOR' && prevTag !== ':' && endImplicitObject()) {
|
||||
|
||||
} else if (inImplicitObject() && tag === 'TERMINATOR' && prevTag !== ',' && !(startsLine && this.looksObjectish(i + 1))) {
|
||||
if (nextTag === 'HERECOMMENT') {
|
||||
return forward(1);
|
||||
}
|
||||
endImplicitObject();
|
||||
} else {
|
||||
break;
|
||||
|
|
|
@ -305,6 +305,7 @@ class exports.Rewriter
|
|||
# the continuation of an object.
|
||||
else if inImplicitObject() and tag is 'TERMINATOR' and prevTag isnt ',' and
|
||||
not (startsLine and @looksObjectish(i + 1))
|
||||
return forward 1 if nextTag is 'HERECOMMENT'
|
||||
endImplicitObject()
|
||||
else
|
||||
break
|
||||
|
|
|
@ -418,3 +418,12 @@ test "#3638: Demand a whitespace after # symbol", ->
|
|||
"""
|
||||
|
||||
eq CoffeeScript.compile(input, bare: on), result
|
||||
|
||||
test "#3761: Multiline comment at end of an object", ->
|
||||
anObject =
|
||||
x: 3
|
||||
###
|
||||
#Comment
|
||||
###
|
||||
|
||||
ok anObject.x is 3
|
||||
|
|
Loading…
Reference in New Issue