Skip to content

Commit feab5d6

Browse files
authored
Merge pull request #514 from ebruchez/patch-1
Refer to fileLevelThis instead of globalThis
2 parents fe55064 + e4af80f commit feab5d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/interoperability/global-scope.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ As a stop-gap measure, we point to the source code.
245245
{% endcomment %}
246246

247247
The global variable `global` can of course be read with `js.Dynamic.global.global` (the double `global` is intended).
248-
The global `this` can be read with [`js.special.globalThis`](https://github.com/scala-js/scala-js/blob/v1.0.0-M1/library/src/main/scala/scala/scalajs/js/special/package.scala#L40-L70).
248+
The global `this` can be read with [`js.special.fileLevelThis`](https://github.com/scala-js/scala-js/blob/v1.0.0/library/src/main/scala/scala/scalajs/js/special/package.scala#L138-L170).
249249
Together, these can be used to correctly detect the global scope in most environments:
250250

251251
{% highlight scala %}
@@ -256,7 +256,7 @@ val globalObject: js.Dynamic = {
256256
g.global
257257
} else {
258258
// In all other well-known environment, we can use the global `this`
259-
js.special.globalThis.asInstanceOf[js.Dynamic]
259+
js.special.fileLevelThis.asInstanceOf[js.Dynamic]
260260
}
261261
}
262262
{% endhighlight %}

0 commit comments

Comments
 (0)