Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntoine du HAMEL <duhamelantoine1995@gmail.com>2020-08-28 00:36:50 +0300
committerNode.js GitHub Bot <github-bot@iojs.org>2020-09-16 01:17:47 +0300
commitd24eecd7d73959872058ea5cee5cd83a9825fa13 (patch)
tree15ef5802052a690083df0befa0a608cb93b6e54c /lib/internal/modules
parent8e173836538efb95f5ac5e898f177efff681d2aa (diff)
module: use isURLInstance instead of instanceof
PR-URL: https://github.com/nodejs/node/pull/34951 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Derek Lewis <DerekNonGeneric@inf.is>
Diffstat (limited to 'lib/internal/modules')
-rw-r--r--lib/internal/modules/cjs/loader.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/internal/modules/cjs/loader.js b/lib/internal/modules/cjs/loader.js
index 0df388c463e..34507ebdad3 100644
--- a/lib/internal/modules/cjs/loader.js
+++ b/lib/internal/modules/cjs/loader.js
@@ -60,7 +60,7 @@ const {
maybeCacheSourceMap,
rekeySourceMap
} = require('internal/source_map/source_map_cache');
-const { pathToFileURL, fileURLToPath, URL } = require('internal/url');
+const { pathToFileURL, fileURLToPath, isURLInstance } = require('internal/url');
const { deprecate } = require('internal/util');
const vm = require('vm');
const assert = require('internal/assert');
@@ -1169,7 +1169,7 @@ const createRequireError = 'must be a file URL object, file URL string, or ' +
function createRequire(filename) {
let filepath;
- if (filename instanceof URL ||
+ if (isURLInstance(filename) ||
(typeof filename === 'string' && !path.isAbsolute(filename))) {
try {
filepath = fileURLToPath(filename);