JSInterop

object JSInterop

Management of the interoperability with JavaScript.

This object only contains forwarders for extension methods in transform.sjs.JSSymUtils. They are kept to minimize changes in JSCodeGen in the short term, but it will eventually be removed.

class Object
trait Matchable
class Any

Value members

Concrete methods

Should this symbol be translated into a JS bracket access?

Should this symbol be translated into a JS bracket access?

This is true for methods annotated with @JSBracketAccess.

Should this symbol be translated into a JS bracket call?

Should this symbol be translated into a JS bracket call?

This is true for methods annotated with @JSBracketCall.

Is this symbol a default param accessor for a JS method?

Is this symbol a default param accessor for a JS method?

For default param accessors of constructors, we need to test whether the companion class of the owner is a JS type; not whether the owner is a JS type.

def isJSGetter(sym: Symbol)(using Context): Boolean

Should this symbol be translated into a JS getter?

Should this symbol be translated into a JS getter?

This is true for any parameterless method, i.e., defined without (). Unlike SymDenotations.isGetter, it applies to user-defined methods as much as accessor methods created for vals and vars.

def isJSSetter(sym: Symbol)(using Context): Boolean

Should this symbol be translated into a JS setter?

Should this symbol be translated into a JS setter?

This is true for any method whose name ends in _=. Unlike SymDenotations.isGetter, it applies to user-defined methods as much as accessor methods created for vars.

def isJSType(sym: Symbol)(using Context): Boolean

Is this symbol a JavaScript type?

Is this symbol a JavaScript type?

def jsNameOf(sym: Symbol)(using Context): JSName

Gets the unqualified JS name of a symbol.

Gets the unqualified JS name of a symbol.

If it is not explicitly specified with an @JSName annotation, the JS name is inferred from the Scala name.