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;