Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib: enforce using primordials.globalThis instead of global #38230

Merged
merged 1 commit into from
Apr 17, 2021

Conversation

aduh95
Copy link
Contributor

@aduh95 aduh95 commented Apr 13, 2021

global.global may be overwritten in user-land, it's probably safer not to rely on it.

$ echo 'Reflect.defineProperty(globalThis, "global", { get() {throw new Error} })' > pre.js
$ node -r ./pre.js
Welcome to Node.js v15.12.0.
Type ".help" for more information.
/Users/duhamean/Documents/node/f.js:2
  get() {throw new Error}
               ^

Error
    at get (…/pre.js:1:61)
    at REPLServer.createContext (node:repl:1011:5)
    at REPLServer.resetContext (node:repl:1059:23)
    at new REPLServer (node:repl:720:8)
    at Object.start (node:repl:982:10)
    at Object.createRepl [as createInternalRepl] (node:internal/repl:51:21)
    at node:internal/main/repl:41:13
    at Object.loadESM (node:internal/process/esm_loader:68:11)

@nodejs-github-bot nodejs-github-bot added lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. labels Apr 13, 2021
@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot
Copy link
Collaborator

nodejs-github-bot commented Apr 13, 2021

@aduh95 aduh95 added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Apr 14, 2021
@jasnell jasnell removed the needs-ci PRs that need a full CI run. label Apr 14, 2021
PR-URL: nodejs#38230
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@aduh95 aduh95 force-pushed the global-primordials branch from 03c63e3 to d756d2b Compare April 17, 2021 13:31
@aduh95
Copy link
Contributor Author

aduh95 commented Apr 17, 2021

Landed in d756d2b

@aduh95 aduh95 merged commit d756d2b into nodejs:master Apr 17, 2021
@aduh95 aduh95 deleted the global-primordials branch April 17, 2021 13:31
aduh95 added a commit to aduh95/node that referenced this pull request Jul 19, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
PR-URL: nodejs#38230
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
richardlau pushed a commit that referenced this pull request Jul 20, 2021
PR-URL: #38230
Backport-PR-URL: #39448
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@richardlau
Copy link
Member

Backported to v14.x-staging in #39448.

richardlau pushed a commit that referenced this pull request Jul 20, 2021

Verified

This commit was signed with the committer’s verified signature.
targos Michaël Zasso
PR-URL: #38230
Backport-PR-URL: #39448
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
@richardlau richardlau mentioned this pull request Jul 20, 2021
foxxyz pushed a commit to foxxyz/node that referenced this pull request Oct 18, 2021

Verified

This commit was signed with the committer’s verified signature.
targos Michaël Zasso
PR-URL: nodejs#38230
Backport-PR-URL: nodejs#39448
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
aduh95 added a commit to aduh95/node that referenced this pull request Feb 16, 2022
nodejs-github-bot pushed a commit that referenced this pull request Feb 18, 2022
Refs: #38230
Refs: #38419

PR-URL: #42014
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
bengl pushed a commit to bengl/node that referenced this pull request Feb 21, 2022
Refs: nodejs#38230
Refs: nodejs#38419

PR-URL: nodejs#42014
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
bengl pushed a commit to bengl/node that referenced this pull request Feb 21, 2022
Refs: nodejs#38230
Refs: nodejs#38419

PR-URL: nodejs#42014
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
bengl pushed a commit that referenced this pull request Feb 21, 2022
Refs: #38230
Refs: #38419

PR-URL: #42014
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
bengl pushed a commit that referenced this pull request Feb 21, 2022
Refs: #38230
Refs: #38419

PR-URL: #42014
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
bengl pushed a commit that referenced this pull request Feb 22, 2022
Refs: #38230
Refs: #38419

PR-URL: #42014
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
danielleadams pushed a commit to danielleadams/node that referenced this pull request Apr 21, 2022
Refs: nodejs#38230
Refs: nodejs#38419

PR-URL: nodejs#42014
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
danielleadams pushed a commit that referenced this pull request Apr 24, 2022
Refs: #38230
Refs: #38419

PR-URL: #42014
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
danielleadams pushed a commit that referenced this pull request Apr 24, 2022
Refs: #38230
Refs: #38419

PR-URL: #42014
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Shingo Inoue <leko.noor@gmail.com>
Reviewed-By: Mestery <mestery@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. lib / src Issues and PRs related to general changes in the lib or src directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants