Skip to content

Commit

Permalink
RELEASE: v2.37.3
Browse files Browse the repository at this point in the history
* Fix primitive revival for `undefined` and `Infinity`.
  • Loading branch information
tmedwards authored Jul 27, 2024
2 parents 6291935 + 19493ee commit b40136c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion dist/format.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/core/twinescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ The following types of values are natively supported by SugarCube and may be saf
### Primitives

* Booleans—e.g., `true` & `false`
* Numbers—e.g., `42`, `3.14`, & `-17.01`
* Numbers—e.g., `42`, `3.14`, `-24`, `-17.76`, & `Infinity`
* Strings—e.g., `"I like pie"` & `'You like pie'`
* `null`
* `undefined`
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "SugarCube",
"version": "2.37.2",
"version": "2.37.3",
"author": "Thomas Michael Edwards <[email protected]>",
"description": "Dependency install configuration for SugarCube's Node.js-hosted build script, build.js.",
"license": "BSD-2-Clause",
Expand Down
10 changes: 5 additions & 5 deletions src/lib/serial.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ var Serial = (() => { // eslint-disable-line no-unused-vars, no-var
}

// Handle supported primitive values unsupported by JSON.
switch (typeof value) {
case 'undefined':
value = ['(revive:)', 'undefined'];
switch (value) {
case undefined:
value = ['(revive:)', ['undefined']];
break;

case 'Infinity':
value = ['(revive:)', 'Infinity'];
case Infinity:
value = ['(revive:)', ['Infinity']];
break;
}

Expand Down

0 comments on commit b40136c

Please sign in to comment.