Commit bd1d237
committed
fix: marshal Undefined and SafeString DOM values in Lua
`domValue_push` handled `Null`, `Boolean`, `Integer`, `String`, `Array`,
and `Object`, and aborted via `MRDOCS_UNREACHABLE` for any other kind.
Reading a field whose value is `Undefined` or `SafeString` therefore
crashed a Lua script.
`Undefined` is common: a symbol with no name (the global namespace, for
instance) has an `Undefined` name, so a Lua script that reads
`symbol.name` aborted the build.
So, map `Undefined` to `nil`, as `Null` already is, and push a
`SafeString` as its bytes, the way `String` is handled. This matches the
JavaScript bridge.1 parent 224c795 commit bd1d237
1 file changed
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
643 | 643 | | |
644 | 644 | | |
645 | 645 | | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
646 | 652 | | |
647 | 653 | | |
648 | 654 | | |
649 | 655 | | |
650 | 656 | | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
651 | 660 | | |
652 | 661 | | |
653 | 662 | | |
| |||
0 commit comments