summaryrefslogtreecommitdiff
path: root/lib/url.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/url.js')
-rw-r--r--lib/url.js12
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/url.js b/lib/url.js
index 2db780c7eb..1623de56ca 100644
--- a/lib/url.js
+++ b/lib/url.js
@@ -1,15 +1,7 @@
'use strict';
-function importPunycode() {
- try {
- return process.binding('icu');
- } catch (e) {
- return require('punycode');
- }
-}
-
-const { toASCII } = importPunycode();
-
+const { toASCII } = process.binding('config').hasIntl ?
+ process.binding('icu') : require('punycode');
const { StorageObject, hexTable } = require('internal/querystring');
const internalUrl = require('internal/url');
exports.parse = urlParse;