Skip to content

Commit

Permalink
loader: use path.sep for windows support
Browse files Browse the repository at this point in the history
Use the path.sep variable for handling windows support.

Refs: nodejs#46826 (comment)
  • Loading branch information
jlenon7 committed Mar 8, 2023
1 parent c5e3ea8 commit ad30179
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/internal/modules/esm/register.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const { dirname } = require('path');
const { sep, dirname } = require('path');
const { pathToFileURL } = require('internal/url');
const { getHooksProxy } = require('internal/modules/esm/loader');

Expand All @@ -16,7 +16,7 @@ const { getHooksProxy } = require('internal/modules/esm/loader');
*/
async function registerLoader(urlOrSpecifier) {
const hooksProxy = getHooksProxy();
const parentURL = pathToFileURL(dirname(process.argv[1]) + '/').href
const parentURL = pathToFileURL(dirname(process.argv[1]) + sep).href

await hooksProxy.makeAsyncRequest('registerLoader', urlOrSpecifier, parentURL)
}
Expand Down

0 comments on commit ad30179

Please sign in to comment.