mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
fixed #1322; block comments no longer get out of implicitly called implicit objects
This commit is contained in:
parent
d2d02bf91d
commit
9b9612e09c
3 changed files with 14 additions and 2 deletions
|
@ -662,7 +662,7 @@
|
|||
_ref2 = node.base.properties;
|
||||
for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
|
||||
prop = _ref2[_j];
|
||||
if (prop instanceof Assign) {
|
||||
if (prop instanceof Assign || prop instanceof Comment) {
|
||||
if (!obj) {
|
||||
nodes.push(obj = new Obj(properties = [], true));
|
||||
}
|
||||
|
|
|
@ -520,7 +520,7 @@ exports.Call = class Call extends Base
|
|||
continue
|
||||
obj = null
|
||||
for prop in node.base.properties
|
||||
if prop instanceof Assign
|
||||
if prop instanceof Assign or prop instanceof Comment
|
||||
nodes.push obj = new Obj properties = [], true if not obj
|
||||
properties.push prop
|
||||
else
|
||||
|
|
|
@ -221,3 +221,15 @@ test "#1436: `for` etc. work as normal property names", ->
|
|||
eq no, obj.hasOwnProperty 'for'
|
||||
obj.for = 'foo' of obj
|
||||
eq yes, obj.hasOwnProperty 'for'
|
||||
|
||||
test "#1322: implicit call against implicit object with block comments", ->
|
||||
((obj, arg) ->
|
||||
eq obj.x * obj.y, 6
|
||||
ok not arg
|
||||
)
|
||||
###
|
||||
x
|
||||
###
|
||||
x: 2
|
||||
### y ###
|
||||
y: 3
|
||||
|
|
Loading…
Add table
Reference in a new issue