From cdc8c09c37841edd24b92bf26a39292c8efbe09a Mon Sep 17 00:00:00 2001 From: Jan Zimmek Date: Fri, 24 Feb 2012 09:05:08 +0100 Subject: [PATCH] fix test - single empty string entry --- lib/arrayParser.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/arrayParser.js b/lib/arrayParser.js index f138a361..e14f8e90 100644 --- a/lib/arrayParser.js +++ b/lib/arrayParser.js @@ -31,9 +31,9 @@ ArrayParser.prototype.nextChar = function() { ArrayParser.prototype.record = function(char) { return this.recorded.push(char); }; -ArrayParser.prototype.newEntry = function() { +ArrayParser.prototype.newEntry = function(includeEmpty) { var entry; - if (this.recorded.length > 0) { + if (this.recorded.length > 0 || includeEmpty) { entry = this.recorded.join(""); if (entry === "NULL") { entry = null; @@ -70,7 +70,7 @@ ArrayParser.prototype.parse = function(nested) { } } else if (c.char === '"' && !c.escaped) { if (quote) { - this.newEntry(); + this.newEntry(true); } quote = !quote; } else if (c.char === ',' && !quote) {