Merge pull request #3322 from xixixao/issue1099

Fix #1099, remove in empty array optimization
This commit is contained in:
Jeremy Ashkenas
2014-01-23 07:16:00 -08:00
3 changed files with 6 additions and 6 deletions

View File

@@ -1719,7 +1719,7 @@ exports.In = class In extends Base
invert: NEGATE
compileNode: (o) ->
if @array instanceof Value and @array.isArray()
if @array instanceof Value and @array.isArray() and @array.base.objects.length
for obj in @array.base.objects when obj instanceof Splat
hasSplat = yes
break
@@ -1728,7 +1728,6 @@ exports.In = class In extends Base
@compileLoopTest o
compileOrTest: (o) ->
return [@makeCode("#{!!@negated}")] if @array.base.objects.length is 0
[sub, ref] = @object.cache o, LEVEL_OP
[cmp, cnj] = if @negated then [' !== ', ' && '] else [' === ', ' || ']
tests = []