-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit 256e684
Scala.js: Handle
Previously, if an `@JSName` annotation had an argument that was
not a literal, but a reference to a constant expression (such as
a `final val`), it would not be constant-folded in the generated
Scala.js IR.
This produced worse code than necessary. For Wasm, it was
particularly bad, as the names must then be evaluated on the Wasm
side instead of being pushed to the custom JS helpers.@JSName
annots with constant-folded arguments.1 parent ca400bd commit 256e684
File tree
2 files changed
+9
-8
lines changed- compiler/src/dotty/tools/dotc/transform/sjs
2 files changed
+9
-8
lines changedLines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
164 | 164 |
| |
165 | 165 |
| |
166 | 166 |
| |
167 | - | ||
168 | - | ||
169 | - | ||
167 | + | ||
168 | + | ||
169 | + | ||
170 | 170 |
| |
171 | 171 |
| |
172 | 172 |
| |
|
Lines changed: 6 additions & 5 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
154 | 154 |
| |
155 | 155 |
| |
156 | 156 |
| |
157 | - | ||
157 | + | ||
158 | 158 |
| |
159 | 159 |
| |
160 | 160 |
| |
| |||
1089 | 1089 |
| |
1090 | 1090 |
| |
1091 | 1091 |
| |
1092 | - | ||
1092 | + | ||
1093 | 1093 |
| |
1094 | 1094 |
| |
1095 | 1095 |
| |
1096 | 1096 |
| |
1097 | 1097 |
| |
1098 | 1098 |
| |
1099 | - | ||
1099 | + | ||
1100 | 1100 |
| |
1101 | 1101 |
| |
1102 | - | ||
1102 | + | ||
1103 | + | ||
1103 | 1104 |
| |
1104 | 1105 |
| |
1105 | 1106 |
| |
| |||
1109 | 1110 |
| |
1110 | 1111 |
| |
1111 | 1112 |
| |
1112 | - | ||
1113 | + | ||
1113 | 1114 |
| |
1114 | 1115 |
| |
1115 | 1116 |
| |
|
0 commit comments