From 7afb73715f161ea14924eceb6f03b502f32ac8fd Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Mon, 7 May 2018 02:18:14 +0200 Subject: [PATCH] lib: remove unnecessary require The call to url was not necessary since the `url` module itself was already taking care of this. PR-URL: https://github.com/nodejs/node/pull/20567 Reviewed-By: Gus Caplan Reviewed-By: Matteo Collina Reviewed-By: James M Snell Reviewed-By: Jeremiah Senkpiel --- lib/internal/bootstrap/node.js | 4 ---- lib/url.js | 2 ++ 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js index 96d07331985..bdd2edce866 100644 --- a/lib/internal/bootstrap/node.js +++ b/lib/internal/bootstrap/node.js @@ -90,10 +90,6 @@ setupGlobalURL(); } - // Ensure setURLConstructor() is called before the native - // URL::ToObject() method is used. - NativeModule.require('internal/url'); - // On OpenBSD process.execPath will be relative unless we // get the full path before process.execPath is used. if (process.platform === 'openbsd') { diff --git a/lib/url.js b/lib/url.js index c517ba7ab3d..3a2c3c01ea1 100644 --- a/lib/url.js +++ b/lib/url.js @@ -30,6 +30,8 @@ const { ERR_INVALID_ARG_TYPE } = require('internal/errors').codes; +// This ensures setURLConstructor() is called before the native +// URL::ToObject() method is used. const { spliceOne } = require('internal/util'); // WHATWG URL implementation provided by internal/url