Commit 3c520b0
committed
BridgeJS: Emit static members in declare global class declarations
The `declare global { namespace ... }` class stub rendered every method
without `static` and filtered properties to instance-only, so a `@JS static
func` on a namespaced class was typed as an instance method and a `@JS
static var` was omitted from the generated `.d.ts`.
This was a type-only defect: the emitted JavaScript already exposes these
members statically (and the class's namespace export entry types them
correctly), so only TypeScript consumers were affected. Split static and
instance members in this path: emit static methods with `static` and
include static properties.
This has been incorrect since the global namespace class stub was
introduced, not a regression. The `Namespaces.Global` snapshot already
exercises a namespaced class with `static func`/`static var` but had
recorded the wrong output, so it is updated to the corrected declarations.1 parent 2fc75d4 commit 3c520b0
2 files changed
Lines changed: 9 additions & 6 deletions
File tree
- Plugins/BridgeJS
- Sources/BridgeJSLink
- Tests/BridgeJSToolTests/__Snapshots__/BridgeJSLinkTests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3143 | 3143 | | |
3144 | 3144 | | |
3145 | 3145 | | |
| 3146 | + | |
3146 | 3147 | | |
3147 | | - | |
| 3148 | + | |
3148 | 3149 | | |
3149 | 3150 | | |
3150 | 3151 | | |
3151 | | - | |
3152 | | - | |
3153 | | - | |
| 3152 | + | |
3154 | 3153 | | |
| 3154 | + | |
3155 | 3155 | | |
3156 | | - | |
| 3156 | + | |
| 3157 | + | |
| 3158 | + | |
3157 | 3159 | | |
3158 | 3160 | | |
3159 | 3161 | | |
| |||
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
| 37 | + | |
| 38 | + | |
38 | 39 | | |
39 | 40 | | |
40 | 41 | | |
| |||
0 commit comments