Skip to content

Commit

Permalink
soak accesses no longer consume corresponding operators
Browse files Browse the repository at this point in the history
  • Loading branch information
satyr committed Oct 9, 2010
1 parent c5f922c commit b0e34ed
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 5 deletions.
4 changes: 0 additions & 4 deletions lib/nodes.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion src/nodes.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions test/test_existence.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit b0e34ed

Please sign in to comment.