mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Fixes #1461. Existential assignment now correctly reports if it is a statement.
This commit is contained in:
committed by
Michael Ficarra
parent
0f18dff464
commit
22cee5d2d6
@@ -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);
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user