JSSuperMethodCall
org.scalajs.ir.Trees$.JSSuperMethodCall
sealed case class JSSuperMethodCall(superClass: Tree, receiver: Tree, method: Tree, args: List[TreeOrJSSpread])(implicit pos: Position) extends Tree
Calls a method inherited from the given superClass
on receiver
.
Intuitively, this corresponds to
superClass.prototype[method].call(receiver, ...args)
but retains more structure at the IR level than using an explicit encoding of the above expression.
Given the non-native JS classes
class Bar extends js.Object
class Foo extends Bar
The node
JSSuperBrackerCall(LoadJSConstructor(ClassName("Bar")), receiver, method, args)
which is printed as
super(constructorOf[Bar])::receiver[method](...args)
has the following semantics:
Bar.prototype[method].call(receiver, ...args)
If this happens to be located in an instance method of Foo
, and receiver
happens to be This()
, this is equivalent to the ES6 statement
super[method](...args)
Attributes
- Graph
-
- Supertypes
-
trait Serializabletrait Producttrait Equalsclass Treetrait TreeOrJSSpreadclass IRNodeclass Objecttrait Matchableclass Any
Members list
In this article