Fixes #1461. Existential assignment now correctly reports if it is a statement.

This commit is contained in:
Timothy Jones
2011-06-26 03:08:38 +12:00
committed by Michael Ficarra
parent 0f18dff464
commit 22cee5d2d6
2 changed files with 6 additions and 0 deletions

View File

@@ -1141,6 +1141,9 @@
this.param = options && options.param;
}
Assign.prototype.children = ['variable', 'value'];
Assign.prototype.isStatement = function(o) {
return (o != null ? o.level : void 0) === LEVEL_TOP && __indexOf.call(this.context, "?") >= 0;
};
Assign.prototype.assigns = function(name) {
return this[this.context === 'object' ? 'value' : 'variable'].assigns(name);
};

View File

@@ -911,6 +911,9 @@ exports.Assign = class Assign extends Base
children: ['variable', 'value']
isStatement: (o) ->
o?.level is LEVEL_TOP and "?" in @context
assigns: (name) ->
@[if @context is 'object' then 'value' else 'variable'].assigns name