org.scalajs.core.ir.Trees
Calls a method inherited from the given superClass on receiver.
superClass
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(ClassType(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
Foo
This()
super[method](...args)
Calls a method inherited from the given
superClassonreceiver.Intuitively, this corresponds to
but retains more structure at the IR level than using an explicit encoding of the above expression.
Given the non-native JS classes
The node
which is printed as
super(constructorOf[Bar])::receiver[method](...args)has the following semantics:
If this happens to be located in an instance method of
Foo, *and*receiverhappens to beThis(), this is equivalent to the ES6 statementsuper[method](...args)