Skip to content

globalContext

JSObject globalContext

The global scope that is used to find user-declared interop members.

For example:

dart
library;

@JS()
external String get name;

Reading the top-level member name will execute JavaScript code like <globalContext>.name.

There are subtle differences depending on the compiler, but in general, globalContext can be treated like JavaScript's globalThis.