icu: make process.binding('icu') internal

PR-URL: https://github.com/nodejs/node/pull/23234
Refs: https://github.com/nodejs/node/issues/22160
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
This commit is contained in:
cjihrig committed 2018-10-08 23:42:52 -04:00
1 parent 9930529805
commit 2498c7b18b
7 files changed
+10 -7

No files matched your search

+1 -1
View File
@@ -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.
+2 -1
View File
@@ -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.
+1 -1
View File
@@ -356,7 +356,7 @@ function makeTextDecoderICU() {
decode: _decode,
getConverter,
hasConverter
} = process.binding('icu');
} = internalBinding('icu');
class TextDecoder {
constructor(encoding = 'utf-8', options = {}) {
+1 -1
View File
@@ -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))
+1 -1
View File
@@ -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');
+1 -1
View File
@@ -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
+3 -1
View File
@@ -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');