fixing inline-loop object-in-array tests for instance variables. Issue #481

This commit is contained in:
Jeremy Ashkenas
2010-07-10 09:01:22 -04:00
parent 2f8a29b5a0
commit 7a16db9ad3
3 changed files with 12 additions and 4 deletions

View File

@@ -136,9 +136,9 @@ exports.BaseNode: class BaseNode
class: 'BaseNode'
children: []
unwrap: -> this
unwrap: -> this
isStatement: -> no
isPureStatement: -> no
isPureStatement: -> no
topSensitive: -> no
#### Expressions
@@ -1079,7 +1079,7 @@ exports.InNode: class InNode extends BaseNode
[@arr1, @arr2]: @array.compileReference o, {precompile: yes}
[i, l]: [o.scope.freeVariable(), o.scope.freeVariable()]
prefix: if @obj1 isnt @obj2 then @obj1 + '; ' else ''
"!!(function(){ ${prefix}for (var $i=0, $l=${@arr1}.length; $i<$l; $i++) if (${@arr2}[$i] === $@obj2) return true; })()"
"!!(function(){ ${prefix}for (var $i=0, $l=${@arr1}.length; $i<$l; $i++) if (${@arr2}[$i] === $@obj2) return true; }).call(this)"
#### TryNode