Commit 0887c11
committed
fix: Register Swift classes with both native names
The Objective-C runtime doesn't behave consistently with Swift class
names. Sometimes the mangled name can only be used, other times
the demangled one. To avoid hardcoding any logic which may get
easily broken in the future, we are adding both names in the global
tables and are using the mangled name in signatures.
Observation which lead to this change:
* `objc_getClass(const char *)` - accepts both mangled and demangled
names of Swift classes which are not nested in another class. Nested
classes however can be discovered only by their mangled name.
* `class_getName` - returns the demangled name for Swift classes
which aren't nested, and the mangled one for nested.
* On Mac Catalyst `class_getName` returns the mangled names
no matter whether the class is nested or not.
* Update the `metadata-generator` submodule
* Add an optional demangled name for every metadata entity
* Add a test case with a nested Swift-like class1 parent 325e639 commit 0887c11
6 files changed
Lines changed: 72 additions & 14 deletions
File tree
- src
- NativeScript/Metadata
- tests
- TestFixtures/Interfaces
- TestRunner/app
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| 66 | + | |
66 | 67 | | |
67 | 68 | | |
68 | 69 | | |
| |||
319 | 320 | | |
320 | 321 | | |
321 | 322 | | |
322 | | - | |
| 323 | + | |
323 | 324 | | |
324 | 325 | | |
325 | 326 | | |
| |||
546 | 547 | | |
547 | 548 | | |
548 | 549 | | |
549 | | - | |
550 | | - | |
551 | | - | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
552 | 559 | | |
553 | 560 | | |
554 | 561 | | |
555 | 562 | | |
556 | | - | |
| 563 | + | |
557 | 564 | | |
558 | 565 | | |
559 | 566 | | |
560 | 567 | | |
561 | 568 | | |
562 | 569 | | |
563 | 570 | | |
564 | | - | |
| 571 | + | |
565 | 572 | | |
566 | 573 | | |
567 | 574 | | |
| |||
577 | 584 | | |
578 | 585 | | |
579 | 586 | | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
580 | 591 | | |
581 | 592 | | |
582 | 593 | | |
583 | 594 | | |
584 | 595 | | |
585 | | - | |
| 596 | + | |
586 | 597 | | |
587 | 598 | | |
588 | 599 | | |
589 | | - | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
590 | 605 | | |
591 | 606 | | |
592 | 607 | | |
| |||
605 | 620 | | |
606 | 621 | | |
607 | 622 | | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
608 | 641 | | |
609 | 642 | | |
610 | 643 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
104 | | - | |
105 | | - | |
| 104 | + | |
106 | 105 | | |
107 | 106 | | |
108 | 107 | | |
109 | 108 | | |
110 | 109 | | |
111 | 110 | | |
112 | | - | |
113 | | - | |
114 | | - | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
| |||
Submodule metadata-generator updated 126 files
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
16 | 21 | | |
17 | 22 | | |
| 23 | + | |
18 | 24 | | |
19 | 25 | | |
20 | 26 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
14 | 18 | | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
18 | 26 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
15 | 22 | | |
0 commit comments