check existence of this.context. Avoid build error
https://github.com/jashkenas/coffee-script/issues/1541 with thanks to analyst74 whose bug report made the fix trivial =)
This commit is contained in:
parent
e7854bec09
commit
178af9de56
|
@ -1144,7 +1144,7 @@
|
||||||
}
|
}
|
||||||
Assign.prototype.children = ['variable', 'value'];
|
Assign.prototype.children = ['variable', 'value'];
|
||||||
Assign.prototype.isStatement = function(o) {
|
Assign.prototype.isStatement = function(o) {
|
||||||
return (o != null ? o.level : void 0) === LEVEL_TOP && __indexOf.call(this.context, "?") >= 0;
|
return (o != null ? o.level : void 0) === LEVEL_TOP && (this.context != null) && __indexOf.call(this.context, "?") >= 0;
|
||||||
};
|
};
|
||||||
Assign.prototype.assigns = function(name) {
|
Assign.prototype.assigns = function(name) {
|
||||||
return this[this.context === 'object' ? 'value' : 'variable'].assigns(name);
|
return this[this.context === 'object' ? 'value' : 'variable'].assigns(name);
|
||||||
|
|
|
@ -917,7 +917,7 @@ exports.Assign = class Assign extends Base
|
||||||
children: ['variable', 'value']
|
children: ['variable', 'value']
|
||||||
|
|
||||||
isStatement: (o) ->
|
isStatement: (o) ->
|
||||||
o?.level is LEVEL_TOP and "?" in @context
|
o?.level is LEVEL_TOP and @context? and "?" in @context
|
||||||
|
|
||||||
assigns: (name) ->
|
assigns: (name) ->
|
||||||
@[if @context is 'object' then 'value' else 'variable'].assigns name
|
@[if @context is 'object' then 'value' else 'variable'].assigns name
|
||||||
|
|
Loading…
Reference in New Issue