Commit e092688
committed
Scala.js: Add support for the JS operator
This is a forward port of the compiler changes in the Scala.js commit
scala-js/scala-js@5bfa254
It is now possible to use `@JSOperator` on a method named `**` in
a JS type. In that case, it will translate to the JavaScript `**`
operator. This is only valid when emitting ES 2016 or later, as it
is not valid ES 2015 code.
Without an explicit `@JSOperator` annotation, such a method still
defaults to being a method call, to preserve backward
compatibility.**.1 parent 8c9c051 commit e092688
File tree
2 files changed
+40
-30
lines changed- compiler/src/dotty/tools
- backend/sjs
- dotc/transform/sjs
2 files changed
+40
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| |||
Lines changed: 38 additions & 30 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
80 | 86 | | |
81 | 87 | | |
82 | 88 | | |
| |||
232 | 238 | | |
233 | 239 | | |
234 | 240 | | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
239 | 245 | | |
240 | 246 | | |
241 | | - | |
| 247 | + | |
242 | 248 | | |
243 | 249 | | |
244 | 250 | | |
245 | 251 | | |
246 | 252 | | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
267 | 275 | | |
268 | 276 | | |
269 | | - | |
| 277 | + | |
270 | 278 | | |
271 | 279 | | |
272 | 280 | | |
0 commit comments