soak accesses no longer consume corresponding operators

This commit is contained in:
satyr 2010-10-10 07:10:20 +09:00
parent c5f922c5db
commit b0e34edf99
3 changed files with 1 additions and 5 deletions

View File

@ -1382,10 +1382,6 @@
return Op.__super__.toString.call(this, idt, this.constructor.name + ' ' + this.operator);
};
Op.prototype.compileNode = function(o) {
var node;
if (node = Value.unfoldSoak(o, this, 'first')) {
return node.compile(o);
}
if (this.isChainable() && this.first.unwrap() instanceof Op && this.first.unwrap().isChainable()) {
return this.compileChain(o);
}

View File

@ -1201,7 +1201,6 @@ exports.Op = class Op extends Base
super(idt, @constructor.name + ' ' + @operator)
compileNode: (o) ->
return node.compile o if node = Value.unfoldSoak o, this, 'first'
return @compileChain(o) if @isChainable() and @first.unwrap() instanceof Op and @first.unwrap().isChainable()
return @compileAssignment(o) if indexOf(@ASSIGNMENT, @operator) >= 0
return @compileUnary(o) if @isUnary()

View File

@ -92,6 +92,7 @@ ok not value?.property?, 'safely checks existence on soaks'
eq nothing?.value, undefined, 'safely calls values off of non-existent variables'
eq !nothing?.value and 1, 1, 'corresponding operators work as expected'
# Assign to the result of an exsitential operation with a minus.