Skip to content

Commit 0497c07

Browse files
committed
fixes #1099: instead of nothing, compile to false
"if a in []"
1 parent 61918a1 commit 0497c07

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/nodes.js

+3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/nodes.coffee

+1
Original file line numberDiff line numberDiff line change
@@ -1340,6 +1340,7 @@ exports.In = class In extends Base
13401340
[cmp, cnj] = if @negated then [' !== ', ' && '] else [' === ', ' || ']
13411341
tests = for item, i in @array.base.objects
13421342
(if i then ref else sub) + cmp + item.compile o, LEVEL_OP
1343+
return 'false' if tests.length is 0
13431344
tests = tests.join cnj
13441345
if o.level < LEVEL_OP then tests else "(#{tests})"
13451346

0 commit comments

Comments
 (0)