mirror of
https://github.com/zebrajr/node.git
synced 2026-01-15 12:15:26 +00:00
dns: use url module instead of punycode for IDNA
PR-URL: https://github.com/nodejs/node/pull/35091 Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michaël Zasso <targos@protonmail.com>
This commit is contained in:
@@ -51,6 +51,7 @@ option:
|
||||
| `String.prototype.toLocale*Case()` | partial (not locale-aware) | full | full | full |
|
||||
| [`Number.prototype.toLocaleString()`][] | partial (not locale-aware) | partial/full (depends on OS) | partial (English-only) | full |
|
||||
| `Date.prototype.toLocale*String()` | partial (not locale-aware) | partial/full (depends on OS) | partial (English-only) | full |
|
||||
| [Legacy URL Parser][] | partial (no IDN support) | full | full | full |
|
||||
| [WHATWG URL Parser][] | partial (no IDN support) | full | full | full |
|
||||
| [`require('buffer').transcode()`][] | none (function does not exist) | full | full | full |
|
||||
| [REPL][] | partial (inaccurate line editing) | full | full | full |
|
||||
@@ -193,6 +194,7 @@ to be helpful:
|
||||
[ECMA-262]: https://tc39.github.io/ecma262/
|
||||
[ECMA-402]: https://tc39.github.io/ecma402/
|
||||
[ICU]: http://site.icu-project.org/
|
||||
[Legacy URL parser]: url.md#url_legacy_url_api
|
||||
[REPL]: repl.md#repl_repl
|
||||
[Test262]: https://github.com/tc39/test262/tree/HEAD/test/intl402
|
||||
[WHATWG URL parser]: url.md#url_the_whatwg_url_api
|
||||
|
||||
@@ -4,6 +4,6 @@ if (internalBinding('config').hasIntl) {
|
||||
const { toASCII, toUnicode } = internalBinding('icu');
|
||||
module.exports = { toASCII, toUnicode };
|
||||
} else {
|
||||
const { toASCII, toUnicode } = require('punycode');
|
||||
module.exports = { toASCII, toUnicode };
|
||||
const { domainToASCII, domainToUnicode } = require('internal/url');
|
||||
module.exports = { toASCII: domainToASCII, toUnicode: domainToUnicode };
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ if (!common.isMainThread) {
|
||||
if (common.hasIntl) {
|
||||
expectedModules.add('Internal Binding icu');
|
||||
} else {
|
||||
expectedModules.add('NativeModule punycode');
|
||||
expectedModules.add('NativeModule url');
|
||||
}
|
||||
|
||||
if (process.features.inspector) {
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
'use strict';
|
||||
require('../common');
|
||||
const common = require('../common');
|
||||
const assert = require('assert');
|
||||
const url = require('url');
|
||||
|
||||
if (!common.hasIntl)
|
||||
common.skip('missing Intl');
|
||||
|
||||
// Formatting tests to verify that it'll format slightly wonky content to a
|
||||
// valid URL.
|
||||
const formatTests = {
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
'use strict';
|
||||
require('../common');
|
||||
const common = require('../common');
|
||||
|
||||
if (!common.hasIntl)
|
||||
common.skip('missing Intl');
|
||||
|
||||
const assert = require('assert');
|
||||
const inspect = require('util').inspect;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user