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 Serializable
trait Product
trait Equals
class Tree
class IRNode
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product
def show: String

Attributes

Inherited from:
IRNode

Concrete fields

val tpe: Type

Implicits

Implicits

implicit val pos: Position