Skip to content

Node FS: Guard on require() existing before requiring. See #17851 - #17917

Merged
kripken merged 1 commit into
mainfrom
guard.require
Sep 23, 2022
Merged

Node FS: Guard on require() existing before requiring. See #17851#17917
kripken merged 1 commit into
mainfrom
guard.require

Conversation

@kripken

@kripken kripken commented Sep 22, 2022

Copy link
Copy Markdown
Member

No description provided.

@kripken
kripken merged commit d315559 into main Sep 23, 2022
@kripken
kripken deleted the guard.require branch September 23, 2022 00:50
Comment thread src/node_shell_read.js
var fs, nodePath;
if (typeof require === 'function') {
fs = require('fs');
nodePath = require('path');

@sbc100 sbc100 Sep 23, 2022

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does having the var inside the condition not work?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it does work. Do we have a style preference?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants