Commit bbd2500
committed
BridgeJS: Use a BigInt zero placeholder for Wasm i64 in generated JS
A Wasm i64 parameter or return value is represented as a JavaScript BigInt.
The generated JS used a plain 0 as the placeholder for the absent case of an
optional i64 parameter (isSome ? v : 0) and for the error-path return of an
imported thunk, so calling such an export with null (or an imported i64
function throwing) raised "TypeError: Cannot convert 0 to a BigInt".
Emit 0n for i64 in both placeholders (jsZeroLiteral and the imported-thunk
return placeholder). This was latent because the optional Int64/UInt64
round-trip tests never exercised the none case; add those assertions.1 parent 2388473 commit bbd2500
5 files changed
Lines changed: 16 additions & 6 deletions
File tree
- Plugins/BridgeJS
- Sources/BridgeJSLink
- Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests
- Tests/BridgeJSRuntimeTests/JavaScript
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3704 | 3704 | | |
3705 | 3705 | | |
3706 | 3706 | | |
3707 | | - | |
| 3707 | + | |
| 3708 | + | |
| 3709 | + | |
| 3710 | + | |
3708 | 3711 | | |
3709 | 3712 | | |
3710 | 3713 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2603 | 2603 | | |
2604 | 2604 | | |
2605 | 2605 | | |
2606 | | - | |
| 2606 | + | |
| 2607 | + | |
| 2608 | + | |
| 2609 | + | |
2607 | 2610 | | |
2608 | 2611 | | |
2609 | 2612 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
440 | 440 | | |
441 | 441 | | |
442 | 442 | | |
443 | | - | |
| 443 | + | |
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
| |||
488 | 488 | | |
489 | 489 | | |
490 | 490 | | |
491 | | - | |
| 491 | + | |
492 | 492 | | |
493 | 493 | | |
494 | 494 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| |||
267 | 267 | | |
268 | 268 | | |
269 | 269 | | |
270 | | - | |
| 270 | + | |
271 | 271 | | |
272 | 272 | | |
273 | 273 | | |
| |||
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
83 | 87 | | |
84 | 88 | | |
85 | 89 | | |
| |||
0 commit comments