-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix 'undefined' absent field name in switch.
The string 'undefined' was being appended to field names when an absent field was used as part of a switch statment. Closes #609.
- Loading branch information
1 parent
e2971e9
commit c902d92
Showing
13 changed files
with
315 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module.exports = function ({ $lookup }) { | ||
return { | ||
object: function () { | ||
return function ($buffer, $start) { | ||
let object = { | ||
value: null | ||
} | ||
|
||
switch (($ => 0)(object)) { | ||
case 0: | ||
object.value = null | ||
|
||
break | ||
|
||
case undefined: | ||
object.value = null | ||
|
||
break | ||
} | ||
|
||
return object | ||
} | ||
} () | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module.exports = function ({ $incremental, $lookup }) { | ||
return { | ||
object: function () { | ||
return function () { | ||
return function ($buffer, $start, $end) { | ||
let object = { | ||
value: null | ||
} | ||
|
||
switch (($ => 0)(object)) { | ||
case 0: | ||
object.value = null | ||
|
||
break | ||
|
||
case undefined: | ||
object.value = null | ||
|
||
break | ||
} | ||
|
||
return { start: $start, object: object, parse: null } | ||
} | ||
} () | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module.exports = function ({ $incremental, $lookup }) { | ||
return { | ||
object: function () { | ||
return function () { | ||
return function ($buffer, $start, $end) { | ||
let object = { | ||
value: null | ||
} | ||
|
||
switch (($ => 0)(object)) { | ||
case 0: | ||
object.value = null | ||
|
||
break | ||
|
||
case undefined: | ||
object.value = null | ||
|
||
break | ||
} | ||
|
||
return { start: $start, object: object, parse: null } | ||
} | ||
} () | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
module.exports = function ({ $lookup }) { | ||
return { | ||
object: function () { | ||
return function (object, $step = 0) { | ||
|
||
return function $parse ($buffer, $start, $end) { | ||
for (;;) { | ||
switch ($step) { | ||
case 0: | ||
|
||
object = { | ||
value: null | ||
} | ||
|
||
case 1: | ||
|
||
switch (($ => 0)(object)) { | ||
case 0: | ||
|
||
$step = 2 | ||
continue | ||
|
||
case undefined: | ||
|
||
$step = 3 | ||
continue | ||
} | ||
|
||
case 2: | ||
|
||
object.value = null | ||
$step = 4 | ||
continue | ||
|
||
case 3: | ||
|
||
object.value = null | ||
|
||
} | ||
|
||
return { start: $start, object: object, parse: null } | ||
break | ||
} | ||
} | ||
} | ||
} () | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = function ({ $lookup }) { | ||
return { | ||
object: function () { | ||
return function (object, $buffer, $start) { | ||
switch (($ => 0)(object)) { | ||
case 0: | ||
|
||
|
||
break | ||
|
||
case undefined: | ||
|
||
|
||
break | ||
} | ||
|
||
return { start: $start, serialize: null } | ||
} | ||
} () | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module.exports = function ({ $incremental, $lookup }) { | ||
return { | ||
object: function () { | ||
return function (object) { | ||
return function ($buffer, $start, $end) { | ||
switch (($ => 0)(object)) { | ||
case 0: | ||
|
||
|
||
break | ||
|
||
case undefined: | ||
|
||
|
||
break | ||
} | ||
|
||
return { start: $start, serialize: null } | ||
} | ||
} | ||
} () | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module.exports = function ({ $incremental, $lookup }) { | ||
return { | ||
object: function () { | ||
return function (object) { | ||
return function ($buffer, $start, $end) { | ||
switch (($ => 0)(object)) { | ||
case 0: | ||
|
||
|
||
break | ||
|
||
case undefined: | ||
|
||
|
||
break | ||
} | ||
|
||
return { start: $start, serialize: null } | ||
} | ||
} | ||
} () | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
module.exports = function ({ $lookup }) { | ||
return { | ||
object: function () { | ||
return function (object, $step = 0) { | ||
return function $serialize ($buffer, $start, $end) { | ||
for (;;) { | ||
switch ($step) { | ||
case 0: | ||
|
||
switch (($ => 0)(object)) { | ||
case 0: | ||
|
||
$step = 1 | ||
continue | ||
|
||
case undefined: | ||
|
||
$step = 2 | ||
continue | ||
} | ||
|
||
case 1: | ||
$step = 3 | ||
continue | ||
|
||
case 2: | ||
|
||
} | ||
|
||
break | ||
} | ||
|
||
return { start: $start, serialize: null } | ||
} | ||
} | ||
} () | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = { | ||
object: function () { | ||
return function (object) { | ||
let $start = 0 | ||
|
||
switch (($ => 0)(object)) { | ||
case 0: | ||
|
||
|
||
break | ||
|
||
case undefined: | ||
|
||
|
||
break | ||
} | ||
|
||
return $start | ||
} | ||
} () | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters