There was an error while loading. Please reload this page.
hasIntl
try-catch
1 parent fb71ba4 commit 50e7e6eCopy full SHA for 50e7e6e
lib/url.js
@@ -1,15 +1,7 @@
1
'use strict';
2
3
-function importPunycode() {
4
- try {
5
- return process.binding('icu');
6
- } catch (e) {
7
- return require('punycode');
8
- }
9
-}
10
-
11
-const { toASCII } = importPunycode();
12
+const { toASCII } = process.binding('config').hasIntl ?
+ process.binding('icu') : require('punycode');
13
const { StorageObject, hexTable } = require('internal/querystring');
14
const internalUrl = require('internal/url');
15
exports.parse = urlParse;
0 commit comments