-
Notifications
You must be signed in to change notification settings - Fork 396
Closed
Labels
bugConfirmed bug. Needs to be fixed.Confirmed bug. Needs to be fixed.
Milestone
Description
import scala.scalajs.js.annotation._
@JSExportTopLevel("Functions")
object Functions {
@JSExport("$a")
def f(x: Int): Int = x
@JSExport
def +(x: Int): Int = x
@JSExport("-")
def plus(x: Int): Int = x
// OK
@JSExport("plus")
def ++(x: Int): Int = x
}
Only the last function is actually exported. All the other ones vanish. The problem is already apparent in the IR:
> scalajsp Functions$.sjsir
module class LFunctions$ extends O {
def f__I__I(x: int): int = {
x
}
def $$plus__I__I(x: int): int = {
x
}
def plus__I__I(x: int): int = {
x
}
def $$plus$plus__I__I(x: int): int = {
x
}
def $$js$exported$meth$$a__I__O(x: int): any = {
this.f__I__I(x)
}
def $$js$exported$meth$$plus__I__O(x: int): any = {
this.$$plus__I__I(x)
}
def $$js$exported$meth$$minus__I__O(x: int): any = {
this.plus__I__I(x)
}
def $$js$exported$meth$plus__I__O(x: int): any = {
this.$$plus$plus__I__I(x)
}
def init___() {
this.O::init___();
mod:LFunctions$<-this
}
def "plus"(arg$1: any): any = {
val prep0: int = arg$1.asInstanceOf[I];
this.$$js$exported$meth$plus__I__O(prep0)
}
export top module "Functions"
}
Metadata
Metadata
Assignees
Labels
bugConfirmed bug. Needs to be fixed.Confirmed bug. Needs to be fixed.