Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/internal/modules/cjs/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,10 @@ const {
stripBOM,
stripShebang
} = require('internal/modules/cjs/helpers');
const preserveSymlinks = !!process.binding('config').preserveSymlinks;
const preserveSymlinksMain = !!process.binding('config').preserveSymlinksMain;
const experimentalModules = !!process.binding('config').experimentalModules;
const options = internalBinding('options');
const preserveSymlinks = !!options.getOptions('--preserve-symlinks');
Copy link
Member

Choose a reason for hiding this comment

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

there's no need for the !! here, as options.getOptions already returns true/false

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've removed the !! in a second commit. I wasn't sure whether I should or not, as they were there for the old code. Thanks!

const preserveSymlinksMain = !!options.getOptions('--preserve-symlinks-main');
const experimentalModules = !!options.getOptions('--experimental-modules');

const {
ERR_INVALID_ARG_TYPE,
Expand Down