Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 035356f

Browse filesBrowse files
tniessenMoLow
authored andcommitted
doc: update description of global
With widespread support for ES modules, the description of global is outdated now. PR-URL: #47969 Reviewed-By: Debadree Chatterjee <debadree333@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent dab3186 commit 035356f
Copy full SHA for 035356f

File tree

Expand file treeCollapse file tree

1 file changed

+8
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-4
lines changed
Open diff view settings
Collapse file

‎doc/api/globals.md‎

Copy file name to clipboardExpand all lines: doc/api/globals.md
+8-4Lines changed: 8 additions & 4 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,12 @@ added: v0.1.27
473473
474474
* {Object} The global namespace object.
475475

476-
In browsers, the top-level scope is the global scope. This means that
477-
within the browser `var something` will define a new global variable. In
478-
Node.js this is different. The top-level scope is not the global scope;
479-
`var something` inside a Node.js module will be local to that module.
476+
In browsers, the top-level scope has traditionally been the global scope. This
477+
means that `var something` will define a new global variable, except within
478+
ECMAScript modules. In Node.js, this is different. The top-level scope is not
479+
the global scope; `var something` inside a Node.js module will be local to that
480+
module, regardless of whether it is a [CommonJS module][] or an
481+
[ECMAScript module][].
480482

481483
## Class `Headers`
482484

@@ -868,6 +870,8 @@ added: v18.0.0
868870
869871
A browser-compatible implementation of [`WritableStreamDefaultWriter`][].
870872

873+
[CommonJS module]: modules.md
874+
[ECMAScript module]: esm.md
871875
[Web Crypto API]: webcrypto.md
872876
[`--experimental-global-customevent`]: cli.md#--experimental-global-customevent
873877
[`--experimental-global-webcrypto`]: cli.md#--experimental-global-webcrypto

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.