bugfix...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2025-12-26 05:15:06 +03:00
parent a37ba58afb
commit a03f493893
2 changed files with 4 additions and 1 deletions

View File

@ -328,7 +328,10 @@ module.eJSON = {
&& initial.length++ && initial.length++
continue } continue }
if(str.slice(i, i+EMPTY.length) == EMPTY){ if(str.slice(i, i+EMPTY.length) == EMPTY){
index++
i += EMPTY.length i += EMPTY.length
if(str[i] == ','){
i++ }
// XXX this feels hackish -- can this be deligated to the handler??? // XXX this feels hackish -- can this be deligated to the handler???
initial instanceof Array initial instanceof Array
&& initial.length++ && initial.length++

View File

@ -37,7 +37,7 @@ var setups = test.Setups({
return '[]' }, return '[]' },
// XXX BUG: trailing <empty> gets duplicated... // XXX BUG: trailing <empty> gets duplicated...
'array-sparse': function(assert){ 'array-sparse': function(assert){
return '[1,<empty>,<empty>,2,<empty>]' }, return '[<empty>,1,<empty>,<empty>,2,<empty>]' },
'object-empty': function(assert){ 'object-empty': function(assert){
return '{}' }, return '{}' },