From e2ad1190ac71da206885dd410b9ba3141e57c93a Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Fri, 12 Feb 2010 13:52:57 -0500 Subject: [PATCH] Array comprehensions are alive and well on the self-compiler --- lib/coffee_script/nodes.js | 2 +- src/nodes.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/coffee_script/nodes.js b/lib/coffee_script/nodes.js index e19dd48d..401de91d 100644 --- a/lib/coffee_script/nodes.js +++ b/lib/coffee_script/nodes.js @@ -964,7 +964,7 @@ ASSIGNMENT: ['||=', '&&=', '?='], PREFIX_OPERATORS: ['typeof', 'delete'], constructor: function constructor(operator, first, second, flip) { - this.children = [(this.first = first), (this.second = second)]; + this.children = compact([(this.first = first), (this.second = second)]); this.operator = this.CONVERSIONS[operator] || operator; this.flip = !!flip; return this; diff --git a/src/nodes.coffee b/src/nodes.coffee index e00c2452..82424be7 100644 --- a/src/nodes.coffee +++ b/src/nodes.coffee @@ -754,7 +754,7 @@ OpNode: exports.OpNode: inherit Node, { PREFIX_OPERATORS: ['typeof', 'delete'] constructor: (operator, first, second, flip) -> - @children: [@first: first, @second: second] + @children: compact [@first: first, @second: second] @operator: @CONVERSIONS[operator] or operator @flip: !!flip this