1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

Merge pull request #1542 from MichaelBlume/master

Check for existence of this.context. Avoid build error.
This commit is contained in:
Michael Ficarra 2011-08-04 13:23:33 -07:00
commit 1f69200d06
2 changed files with 2 additions and 2 deletions

View file

@ -1144,7 +1144,7 @@
}
Assign.prototype.children = ['variable', 'value'];
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) {
return this[this.context === 'object' ? 'value' : 'variable'].assigns(name);

View file

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