Commit 7fffe0c
committed
fix: emit diagnostic for @js mutating struct methods instead of generating broken code
Per reviewer feedback (wfltaylor): mutations to `_self` are not propagated
back to JavaScript, so the mutable-self binding approach silently discards
all mutations. Replace it with a clear compile-time diagnostic pointing users
to a value-returning redesign.1 parent 360e459 commit 7fffe0c
2 files changed
Lines changed: 20 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
249 | 239 | | |
250 | 240 | | |
251 | 241 | | |
| |||
571 | 561 | | |
572 | 562 | | |
573 | 563 | | |
574 | | - | |
| 564 | + | |
575 | 565 | | |
576 | 566 | | |
577 | 567 | | |
| |||
Lines changed: 11 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1198 | 1198 | | |
1199 | 1199 | | |
1200 | 1200 | | |
1201 | | - | |
1202 | | - | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
1203 | 1210 | | |
1204 | 1211 | | |
1205 | 1212 | | |
| |||
1214 | 1221 | | |
1215 | 1222 | | |
1216 | 1223 | | |
1217 | | - | |
| 1224 | + | |
1218 | 1225 | | |
1219 | 1226 | | |
1220 | 1227 | | |
| |||
1235 | 1242 | | |
1236 | 1243 | | |
1237 | 1244 | | |
1238 | | - | |
| 1245 | + | |
1239 | 1246 | | |
1240 | 1247 | | |
1241 | 1248 | | |
| |||
0 commit comments