Skip to content

Commit 89a58f6

Browse files
aduh95codebytere
authored andcommittedOct 1, 2020
module: use isURLInstance instead of instanceof
PR-URL: nodejs/node#34951 Backport-PR-URL: nodejs/node#35385 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
1 parent bf7b796 commit 89a58f6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎lib/internal/modules/cjs/loader.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const {
5454
maybeCacheSourceMap,
5555
rekeySourceMap
5656
} = require('internal/source_map/source_map_cache');
57-
const { pathToFileURL, fileURLToPath, URL } = require('internal/url');
57+
const { pathToFileURL, fileURLToPath, isURLInstance } = require('internal/url');
5858
const { deprecate } = require('internal/util');
5959
const vm = require('vm');
6060
const assert = require('internal/assert');
@@ -1089,7 +1089,7 @@ const createRequireError = 'must be a file URL object, file URL string, or ' +
10891089
function createRequire(filename) {
10901090
let filepath;
10911091

1092-
if (filename instanceof URL ||
1092+
if (isURLInstance(filename) ||
10931093
(typeof filename === 'string' && !path.isAbsolute(filename))) {
10941094
try {
10951095
filepath = fileURLToPath(filename);

0 commit comments

Comments
 (0)
Failed to load comments.