fixed #1322; block comments no longer get out of implicitly called implicit objects
This commit is contained in:
parent
d2d02bf91d
commit
9b9612e09c
|
@ -662,7 +662,7 @@
|
||||||
_ref2 = node.base.properties;
|
_ref2 = node.base.properties;
|
||||||
for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
|
for (_j = 0, _len2 = _ref2.length; _j < _len2; _j++) {
|
||||||
prop = _ref2[_j];
|
prop = _ref2[_j];
|
||||||
if (prop instanceof Assign) {
|
if (prop instanceof Assign || prop instanceof Comment) {
|
||||||
if (!obj) {
|
if (!obj) {
|
||||||
nodes.push(obj = new Obj(properties = [], true));
|
nodes.push(obj = new Obj(properties = [], true));
|
||||||
}
|
}
|
||||||
|
|
|
@ -520,7 +520,7 @@ exports.Call = class Call extends Base
|
||||||
continue
|
continue
|
||||||
obj = null
|
obj = null
|
||||||
for prop in node.base.properties
|
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
|
nodes.push obj = new Obj properties = [], true if not obj
|
||||||
properties.push prop
|
properties.push prop
|
||||||
else
|
else
|
||||||
|
|
|
@ -221,3 +221,15 @@ test "#1436: `for` etc. work as normal property names", ->
|
||||||
eq no, obj.hasOwnProperty 'for'
|
eq no, obj.hasOwnProperty 'for'
|
||||||
obj.for = 'foo' of obj
|
obj.for = 'foo' of obj
|
||||||
eq yes, obj.hasOwnProperty 'for'
|
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…
Reference in New Issue