Commit d6fe8b9
committed
Scala.js: Add support for js.constructorOf[T].
To do this, we add a new mini-phase that rewrites calls of the form
scala.scalajs.js.constructor[T]
to
scala.scalajs.runtime.constructorOf(classOf[T])
The back-end already knew how to compile calls to
`runtime.constructorOf`, so there were no changes needed there.
The new mini-phase will also serve in the future for handling
inner and local JS classes.1 parent fe5f7a4 commit d6fe8b9
File tree
3 files changed
+70
-7
lines changed- compiler/src/dotty/tools/dotc
- transform
- project
3 files changed
+70
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
Lines changed: 64 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 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1064 | 1064 | | |
1065 | 1065 | | |
1066 | 1066 | | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
1070 | 1070 | | |
1071 | 1071 | | |
1072 | 1072 | | |
1073 | 1073 | | |
1074 | 1074 | | |
1075 | 1075 | | |
1076 | 1076 | | |
1077 | | - | |
1078 | 1077 | | |
1079 | 1078 | | |
1080 | 1079 | | |
| |||
1083 | 1082 | | |
1084 | 1083 | | |
1085 | 1084 | | |
1086 | | - | |
| 1085 | + | |
1087 | 1086 | | |
1088 | 1087 | | |
1089 | 1088 | | |
1090 | 1089 | | |
1091 | 1090 | | |
1092 | 1091 | | |
1093 | 1092 | | |
1094 | | - | |
1095 | 1093 | | |
1096 | 1094 | | |
1097 | 1095 | | |
| |||
1104 | 1102 | | |
1105 | 1103 | | |
1106 | 1104 | | |
1107 | | - | |
| 1105 | + | |
1108 | 1106 | | |
1109 | 1107 | | |
1110 | 1108 | | |
| |||
0 commit comments