Commit cc57cc4
committed
- Static @JSFunction support now round-trips through skeletons with a dedicated
- Import collector keeps JSClass static functions attached to their types (including extensions), avoids type-name prefixing for class-bound statics, and preserves existing global behavior for non-JSClass cases (`Plugins/BridgeJS/Sources/BridgeJSCore/SwiftToSkeleton.swift`).
- Import thunks and JS glue generate distinct `_static` ABI symbols and invoke constructor properties instead of global lookups for static methods, preventing collisions with instance methods (`Plugins/BridgeJS/Sources/BridgeJSCore/ImportTS.swift`, `Plugins/BridgeJS/Sources/BridgeJSLink/BridgeJSLink.swift`).
- Added a macro fixture covering static JS functions (including same-name instance/static and dashed jsName) with new snapshots to guard behavior (`Plugins/BridgeJS/Tests/BridgeJSToolTests/Inputs/MacroSwift/JSClassStaticFunctions.swift`, corresponding snapshot files under `Plugins/BridgeJS/Tests/BridgeJSToolTests/__Snapshots__/BridgeJSCodegenTests/`).
Tests:
- `swift test --package-path ./Plugins/BridgeJS --filter BridgeJSCodegenTests`
Next steps: 1) Run `make unittest SWIFT_SDK_ID=DEVELOPMENT-SNAPSHOT-2025-11-03-a-wasm32-unknown-wasip1` for full coverage.staticMethods collection and backward-compatible encoding/decoding (Plugins/BridgeJS/Sources/BridgeJSSkeleton/BridgeJSSkeleton.swift).1 parent edabb97 commit cc57cc4
File tree
7 files changed
+365
-8
lines changed- Plugins/BridgeJS
- Sources
- BridgeJSCore
- BridgeJSLink
- BridgeJSSkeleton
- Tests/BridgeJSToolTests
- Inputs/MacroSwift
- __Snapshots__/BridgeJSCodegenTests
7 files changed
+365
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
398 | 398 | | |
399 | 399 | | |
400 | 400 | | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
401 | 419 | | |
402 | 420 | | |
403 | 421 | | |
| |||
462 | 480 | | |
463 | 481 | | |
464 | 482 | | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
465 | 487 | | |
466 | 488 | | |
467 | 489 | | |
| |||
Lines changed: 45 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1856 | 1856 | | |
1857 | 1857 | | |
1858 | 1858 | | |
| 1859 | + | |
1859 | 1860 | | |
1860 | 1861 | | |
1861 | 1862 | | |
| |||
1876 | 1877 | | |
1877 | 1878 | | |
1878 | 1879 | | |
| 1880 | + | |
1879 | 1881 | | |
1880 | 1882 | | |
1881 | 1883 | | |
| |||
2094 | 2096 | | |
2095 | 2097 | | |
2096 | 2098 | | |
| 2099 | + | |
2097 | 2100 | | |
2098 | 2101 | | |
2099 | 2102 | | |
| |||
2107 | 2110 | | |
2108 | 2111 | | |
2109 | 2112 | | |
| 2113 | + | |
2110 | 2114 | | |
2111 | 2115 | | |
2112 | 2116 | | |
2113 | 2117 | | |
2114 | 2118 | | |
2115 | 2119 | | |
2116 | 2120 | | |
| 2121 | + | |
2117 | 2122 | | |
2118 | 2123 | | |
2119 | 2124 | | |
2120 | 2125 | | |
2121 | 2126 | | |
2122 | 2127 | | |
2123 | 2128 | | |
| 2129 | + | |
2124 | 2130 | | |
2125 | 2131 | | |
2126 | 2132 | | |
2127 | 2133 | | |
2128 | 2134 | | |
| 2135 | + | |
2129 | 2136 | | |
2130 | 2137 | | |
2131 | 2138 | | |
| |||
2217 | 2224 | | |
2218 | 2225 | | |
2219 | 2226 | | |
2220 | | - | |
2221 | | - | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
| 2233 | + | |
| 2234 | + | |
2222 | 2235 | | |
2223 | 2236 | | |
2224 | 2237 | | |
| |||
2319 | 2332 | | |
2320 | 2333 | | |
2321 | 2334 | | |
2322 | | - | |
| 2335 | + | |
| 2336 | + | |
| 2337 | + | |
| 2338 | + | |
| 2339 | + | |
| 2340 | + | |
| 2341 | + | |
2323 | 2342 | | |
2324 | | - | |
| 2343 | + | |
| 2344 | + | |
| 2345 | + | |
| 2346 | + | |
| 2347 | + | |
| 2348 | + | |
| 2349 | + | |
| 2350 | + | |
| 2351 | + | |
| 2352 | + | |
| 2353 | + | |
| 2354 | + | |
| 2355 | + | |
| 2356 | + | |
| 2357 | + | |
| 2358 | + | |
| 2359 | + | |
| 2360 | + | |
| 2361 | + | |
| 2362 | + | |
2325 | 2363 | | |
2326 | 2364 | | |
2327 | 2365 | | |
| |||
2366 | 2404 | | |
2367 | 2405 | | |
2368 | 2406 | | |
2369 | | - | |
| 2407 | + | |
| 2408 | + | |
2370 | 2409 | | |
2371 | 2410 | | |
2372 | 2411 | | |
| |||
2377 | 2416 | | |
2378 | 2417 | | |
2379 | 2418 | | |
2380 | | - | |
| 2419 | + | |
2381 | 2420 | | |
2382 | 2421 | | |
2383 | 2422 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2246 | 2246 | | |
2247 | 2247 | | |
2248 | 2248 | | |
| 2249 | + | |
| 2250 | + | |
| 2251 | + | |
| 2252 | + | |
| 2253 | + | |
| 2254 | + | |
| 2255 | + | |
| 2256 | + | |
2249 | 2257 | | |
2250 | 2258 | | |
2251 | 2259 | | |
| |||
2318 | 2326 | | |
2319 | 2327 | | |
2320 | 2328 | | |
2321 | | - | |
| 2329 | + | |
2322 | 2330 | | |
2323 | 2331 | | |
2324 | 2332 | | |
| |||
3130 | 3138 | | |
3131 | 3139 | | |
3132 | 3140 | | |
| 3141 | + | |
| 3142 | + | |
| 3143 | + | |
| 3144 | + | |
| 3145 | + | |
| 3146 | + | |
3133 | 3147 | | |
3134 | 3148 | | |
3135 | 3149 | | |
| |||
3207 | 3221 | | |
3208 | 3222 | | |
3209 | 3223 | | |
| 3224 | + | |
| 3225 | + | |
| 3226 | + | |
| 3227 | + | |
| 3228 | + | |
| 3229 | + | |
| 3230 | + | |
| 3231 | + | |
| 3232 | + | |
| 3233 | + | |
| 3234 | + | |
| 3235 | + | |
| 3236 | + | |
| 3237 | + | |
| 3238 | + | |
| 3239 | + | |
| 3240 | + | |
| 3241 | + | |
| 3242 | + | |
| 3243 | + | |
| 3244 | + | |
| 3245 | + | |
| 3246 | + | |
| 3247 | + | |
| 3248 | + | |
| 3249 | + | |
3210 | 3250 | | |
3211 | 3251 | | |
3212 | 3252 | | |
| |||
Lines changed: 50 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
640 | 640 | | |
641 | 641 | | |
642 | 642 | | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
643 | 647 | | |
644 | 648 | | |
645 | | - | |
| 649 | + | |
| 650 | + | |
646 | 651 | | |
647 | 652 | | |
648 | 653 | | |
| |||
752 | 757 | | |
753 | 758 | | |
754 | 759 | | |
| 760 | + | |
| 761 | + | |
755 | 762 | | |
756 | 763 | | |
757 | 764 | | |
| |||
762 | 769 | | |
763 | 770 | | |
764 | 771 | | |
| 772 | + | |
765 | 773 | | |
766 | 774 | | |
767 | 775 | | |
| |||
771 | 779 | | |
772 | 780 | | |
773 | 781 | | |
| 782 | + | |
774 | 783 | | |
775 | 784 | | |
776 | 785 | | |
777 | 786 | | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
778 | 827 | | |
779 | 828 | | |
780 | 829 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
0 commit comments