Commit 8641276
committed
BridgeJS: Simplify Stack ABI for Optional
Now `Optional` conforms to `_BridgedSwiftStackType` whenever `Wrapped`
conforms to `_BridgedSwiftStackType`. This makes generic programming
easier and reduces boilerplate in intrinsics and codegen.
For specialized handling of certain types like associated value enums,
where the presence of a value is encoded as a sentinel case ID (-1),
we implement `bridgeJSStack{Push,Pop}AsOptional` methods, which is on
the witness table of `_BridgedSwiftStackType`.
Also now some of optional types no longer pushes placeholders values for
`nil` cases when pushing in JS and popping in Swift.1 parent cf7a4f3 commit 8641276
File tree
14 files changed
+450
-1054
lines changed- Benchmarks/Sources/Generated
- Plugins/BridgeJS
- Sources
- BridgeJSCore
- BridgeJSLink
- Tests/BridgeJSToolTests/__Snapshots__
- BridgeJSCodegenTests
- BridgeJSLinkTests
- Sources/JavaScriptKit
- Tests/BridgeJSRuntimeTests/Generated
14 files changed
+450
-1054
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
| 233 | + | |
238 | 234 | | |
239 | 235 | | |
240 | 236 | | |
| |||
1603 | 1599 | | |
1604 | 1600 | | |
1605 | 1601 | | |
1606 | | - | |
1607 | | - | |
1608 | | - | |
1609 | | - | |
1610 | | - | |
| 1602 | + | |
1611 | 1603 | | |
1612 | 1604 | | |
1613 | 1605 | | |
| |||
1630 | 1622 | | |
1631 | 1623 | | |
1632 | 1624 | | |
1633 | | - | |
1634 | | - | |
1635 | | - | |
1636 | | - | |
1637 | | - | |
| 1625 | + | |
1638 | 1626 | | |
1639 | 1627 | | |
1640 | 1628 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
824 | 824 | | |
825 | 825 | | |
826 | 826 | | |
827 | | - | |
| 827 | + | |
828 | 828 | | |
829 | 829 | | |
830 | 830 | | |
831 | 831 | | |
832 | 832 | | |
833 | | - | |
834 | | - | |
835 | | - | |
836 | | - | |
837 | 833 | | |
838 | 834 | | |
839 | 835 | | |
| |||
946 | 942 | | |
947 | 943 | | |
948 | 944 | | |
949 | | - | |
950 | | - | |
951 | | - | |
952 | | - | |
953 | | - | |
954 | | - | |
955 | | - | |
956 | | - | |
957 | | - | |
958 | | - | |
959 | | - | |
960 | | - | |
961 | | - | |
962 | | - | |
963 | | - | |
964 | | - | |
965 | | - | |
966 | | - | |
967 | | - | |
968 | | - | |
969 | | - | |
970 | | - | |
971 | | - | |
972 | | - | |
973 | | - | |
974 | | - | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | | - | |
981 | | - | |
982 | | - | |
983 | | - | |
984 | | - | |
985 | | - | |
986 | | - | |
987 | | - | |
988 | | - | |
989 | | - | |
990 | | - | |
991 | | - | |
992 | | - | |
993 | | - | |
994 | | - | |
995 | | - | |
996 | | - | |
997 | 945 | | |
998 | 946 | | |
999 | 947 | | |
| |||
0 commit comments