Marks the annotated class or object as being a member of the JavaScript
global scope.
The annotated class/object must also be annotated with @js.native, and
therefore extend js.Any.
Given:
@js.native
@JSGlobal
class Foo extends js.Object
@js.native
@JSGlobal("Foobar")
object Bar extends js.Object
@js.native
@JSGlobal("Lib.Babar")
class Babar extends js.Object
The following mappings apply (global denotes the global scope):
Scala.js | JavaScript
------------------------+------------------
new Foo() | new global.Foo()
Bar | global.Foobar
js.constructorOf[Babar] | global.Lib.Babar
Marks the annotated class or object as being a member of the JavaScript global scope.
The annotated class/object must also be annotated with
@js.native
, and therefore extend js.Any.Given:
The following mappings apply (
global
denotes the global scope):Calling JavaScript from Scala.js