From 0270e48a0173874df97beeef23779b13ce371c1c Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Thu, 18 Feb 2010 21:04:41 -0500 Subject: [PATCH] using '== null' to check for soaked accessor chains instead of '== undefined' -- shorter, and slightly safer --- lib/nodes.js | 2 +- src/nodes.coffee | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nodes.js b/lib/nodes.js index c6359087..ba3d1381 100644 --- a/lib/nodes.js +++ b/lib/nodes.js @@ -316,7 +316,7 @@ // A value, indexed or dotted into, or vanilla. ValueNode = (exports.ValueNode = inherit(Node, { type: 'Value', - SOAK: " == undefined ? undefined : ", + SOAK: " == null ? undefined : ", constructor: function constructor(base, properties) { this.children = flatten([(this.base = base), (this.properties = (properties || []))]); return this; diff --git a/src/nodes.coffee b/src/nodes.coffee index 9a566161..3cdb2499 100644 --- a/src/nodes.coffee +++ b/src/nodes.coffee @@ -228,7 +228,7 @@ statement ReturnNode, true ValueNode: exports.ValueNode: inherit Node, { type: 'Value' - SOAK: " == undefined ? undefined : " + SOAK: " == null ? undefined : " constructor: (base, properties) -> @children: flatten [@base: base, @properties: (properties or [])]