diff --git a/lib/coffee_script/nodes.js b/lib/coffee_script/nodes.js index 23e68126..49b7af85 100644 --- a/lib/coffee_script/nodes.js +++ b/lib/coffee_script/nodes.js @@ -216,7 +216,7 @@ Expressions = (exports.Expressions = inherit(Node, { type: 'Expressions', constructor: function constructor(nodes) { - this.children = (this.expressions = compact(flatten(nodes))); + this.children = (this.expressions = compact(flatten(nodes || []))); return this; }, // Tack an expression on to the end of this expression list. diff --git a/src/nodes.coffee b/src/nodes.coffee index 4d0bf4d2..8509be16 100644 --- a/src/nodes.coffee +++ b/src/nodes.coffee @@ -120,7 +120,7 @@ Expressions: exports.Expressions: inherit Node, { type: 'Expressions' constructor: (nodes) -> - @children: @expressions: compact flatten nodes + @children: @expressions: compact flatten nodes or [] this # Tack an expression on to the end of this expression list.