fix test - single empty string entry

This commit is contained in:
Jan Zimmek 2012-02-24 09:05:08 +01:00
parent 369357a71f
commit cdc8c09c37

View File

@ -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) {