summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/buffer.js2
-rw-r--r--lib/internal/bootstrap/node.js3
-rw-r--r--lib/internal/encoding.js2
-rw-r--r--lib/internal/readline.js2
-rw-r--r--lib/url.js2
-rw-r--r--src/node_i18n.cc2
-rw-r--r--test/parallel/test-icu-punycode.js4
7 files changed, 10 insertions, 7 deletions
diff --git a/lib/buffer.js b/lib/buffer.js
index f274c51739..2ceb7ce1c9 100644
--- a/lib/buffer.js
+++ b/lib/buffer.js
@@ -1078,7 +1078,7 @@ if (process.binding('config').hasIntl) {
const {
icuErrName,
transcode: _transcode
- } = process.binding('icu');
+ } = internalBinding('icu');
// Transcodes the Buffer from one encoding to another, returning a new
// Buffer instance.
diff --git a/lib/internal/bootstrap/node.js b/lib/internal/bootstrap/node.js
index 65986337c3..740314c8c7 100644
--- a/lib/internal/bootstrap/node.js
+++ b/lib/internal/bootstrap/node.js
@@ -394,6 +394,7 @@
new SafeSet([
'cares_wrap',
'fs_event_wrap',
+ 'icu',
'udp_wrap',
'uv',
'pipe_wrap',
@@ -654,7 +655,7 @@
function setupProcessICUVersions() {
const icu = process.binding('config').hasIntl ?
- process.binding('icu') : undefined;
+ internalBinding('icu') : undefined;
if (!icu) return; // no Intl/ICU: nothing to add here.
// With no argument, getVersion() returns a comma separated list
// of possible types.
diff --git a/lib/internal/encoding.js b/lib/internal/encoding.js
index 161ae72a19..b2448144b0 100644
--- a/lib/internal/encoding.js
+++ b/lib/internal/encoding.js
@@ -356,7 +356,7 @@ function makeTextDecoderICU() {
decode: _decode,
getConverter,
hasConverter
- } = process.binding('icu');
+ } = internalBinding('icu');
class TextDecoder {
constructor(encoding = 'utf-8', options = {}) {
diff --git a/lib/internal/readline.js b/lib/internal/readline.js
index 45125db0c2..0f7d969d20 100644
--- a/lib/internal/readline.js
+++ b/lib/internal/readline.js
@@ -31,7 +31,7 @@ CSI.kClearLine = CSI`2K`;
CSI.kClearScreenDown = CSI`0J`;
if (process.binding('config').hasIntl) {
- const icu = process.binding('icu');
+ const icu = internalBinding('icu');
getStringWidth = function getStringWidth(str, options) {
options = options || {};
if (!Number.isInteger(str))
diff --git a/lib/url.js b/lib/url.js
index ba2033b4e5..db7369fed0 100644
--- a/lib/url.js
+++ b/lib/url.js
@@ -22,7 +22,7 @@
'use strict';
const { toASCII } = process.binding('config').hasIntl ?
- process.binding('icu') : require('punycode');
+ internalBinding('icu') : require('punycode');
const { hexTable } = require('internal/querystring');
diff --git a/src/node_i18n.cc b/src/node_i18n.cc
index 5966e3ff67..fda53cc6d4 100644
--- a/src/node_i18n.cc
+++ b/src/node_i18n.cc
@@ -882,6 +882,6 @@ void Initialize(Local<Object> target,
} // namespace i18n
} // namespace node
-NODE_BUILTIN_MODULE_CONTEXT_AWARE(icu, node::i18n::Initialize)
+NODE_MODULE_CONTEXT_AWARE_INTERNAL(icu, node::i18n::Initialize)
#endif // NODE_HAVE_I18N_SUPPORT
diff --git a/test/parallel/test-icu-punycode.js b/test/parallel/test-icu-punycode.js
index 82c1528798..3744891ee0 100644
--- a/test/parallel/test-icu-punycode.js
+++ b/test/parallel/test-icu-punycode.js
@@ -1,10 +1,12 @@
'use strict';
+// Flags: --expose-internals
const common = require('../common');
if (!common.hasIntl)
common.skip('missing Intl');
-const icu = process.binding('icu');
+const { internalBinding } = require('internal/test/binding');
+const icu = internalBinding('icu');
const assert = require('assert');
const tests = require('../fixtures/url-idna.js');