Dotty Documentation

0.13.0-bin-SNAPSHOT

object JSInterop
extends Object

Management of the interoperability with JavaScript.

[-] Constructors

[-] Members

[+] def fullJSNameOf ( sym: Symbol ) ( implicit ctx: Context ) : String

Gets the fully qualified JS name of a static class of module Symbol.

This is the JS name of the symbol qualified by the fully qualified JS name of its original owner if the latter is a native JS object.

[+] def isJSBracketAccess ( sym: Symbol ) ( implicit ctx: Context ) : Boolean

Should this symbol be translated into a JS bracket access?

This is true for methods annotated with @JSBracketAccess.

[+] def isJSBracketCall ( sym: Symbol ) ( implicit ctx: Context ) : Boolean

Should this symbol be translated into a JS bracket call?

This is true for methods annotated with @JSBracketCall.

[+] def isJSDefaultParam ( sym: Symbol ) ( implicit ctx: Context ) : Boolean

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 ) ( implicit ctx: Context ) : Boolean

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 ) ( implicit ctx: Context ) : Boolean

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 ) ( implicit ctx: Context ) : Boolean

Is this symbol a JavaScript type?

[+] def isScalaJSDefinedJSClass ( sym: Symbol ) ( implicit ctx: Context ) : Boolean

Is this symbol a Scala.js-defined JS class, i.e., a non-native JS class?

[+] def jsNameOf ( sym: Symbol ) ( implicit ctx: Context ) : String

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.