LoadJSConstructor
Loads the constructor of a JS class (native or not).
className
must represent a non-trait JS class (native or not).
This is used typically to instantiate a JS class, and most importantly if it is a non-native JS class. Given the class
class Foo(x: Int) extends js.Object
The instantiation new Foo(1)
would be represented as
JSNew(LoadJSConstructor(ClassName("Foo")), List(IntLiteral(1)))
This node is also useful to encode o.isInstanceOf[Foo]
:
JSBinaryOp(instanceof, o, LoadJSConstructor(ClassName("Foo")))
If Foo
is non-native, the presence of this node makes it instantiable,
and therefore reachable.
trait Serializable
trait Product
trait Equals
class Tree
trait TreeOrJSSpread
class IRNode
class Object
trait Matchable
class Any