From 60a9ad5718cbd0631dc4f9d62cc58df613574e3a Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Mon, 31 Dec 2018 19:12:00 -0800 Subject: [PATCH 1/3] lib,test: remove lib/internal/test/unicode.js Remove lib/internal/test/unicode.js and associated test. When we added the file and test, only comments in lib had non-ASCII characters. Now, lib/internal/cli_table.js has non-ASCII characters. Tests that exercise the `console.table()` therefore fulfill the need to test non-ASCII characters in built-in modules. --- lib/internal/test/unicode.js | 8 -------- node.gyp | 1 - test/parallel/test-internal-unicode.js | 12 ------------ 3 files changed, 21 deletions(-) delete mode 100644 lib/internal/test/unicode.js delete mode 100644 test/parallel/test-internal-unicode.js diff --git a/lib/internal/test/unicode.js b/lib/internal/test/unicode.js deleted file mode 100644 index 451c3c4737898a..00000000000000 --- a/lib/internal/test/unicode.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -// This module exists entirely for regression testing purposes. -// See `test/parallel/test-internal-unicode.js`. - -/* eslint-disable node-core/non-ascii-character */ -module.exports = '✓'; -/* eslint-enable node-core/non-ascii-character */ diff --git a/node.gyp b/node.gyp index d2c3560131b7e5..3ab0257274c430 100644 --- a/node.gyp +++ b/node.gyp @@ -161,7 +161,6 @@ 'lib/internal/socket_list.js', 'lib/internal/test/binding.js', 'lib/internal/test/heap.js', - 'lib/internal/test/unicode.js', 'lib/internal/timers.js', 'lib/internal/tls.js', 'lib/internal/trace_events_async_hooks.js', diff --git a/test/parallel/test-internal-unicode.js b/test/parallel/test-internal-unicode.js deleted file mode 100644 index 0a36309c09f651..00000000000000 --- a/test/parallel/test-internal-unicode.js +++ /dev/null @@ -1,12 +0,0 @@ -'use strict'; -require('../common'); - -// Flags: --expose-internals -// -// This test ensures that UTF-8 characters can be used in core JavaScript -// libraries built into Node's binary. - -const assert = require('assert'); -const character = require('internal/test/unicode'); - -assert.strictEqual(character, '✓'); From 68e8ad2aed71655113db5ce9598ff252fc7166b1 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 2 Jan 2019 20:30:40 -0800 Subject: [PATCH 2/3] fixup! lib,test: remove lib/internal/test/unicode.js --- lib/internal/cli_table.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/internal/cli_table.js b/lib/internal/cli_table.js index f6c711ece8e0ad..678c7866e640ab 100644 --- a/lib/internal/cli_table.js +++ b/lib/internal/cli_table.js @@ -4,6 +4,12 @@ const { Buffer } = require('buffer'); const { removeColors } = require('internal/util'); const HasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty); +// The use of Unicode characters below is the only non-comment use of non-ASCII +// Unicode characters outside of comments in Node.js built-in modules. If they +// are ever removed or rewritten with \u escapes, then a test will need to be +// (re-)added to Node.js core to verify that Unicode characters work in +// built-ins. Otherwise, consumers using Unicode in _third_party_main.js will +// run into problems. Refs: https://github.com/nodejs/node/issues/10673 const tableChars = { /* eslint-disable node-core/non-ascii-character */ middleMiddle: '─', From 836d23bd33c06d7bfff8c9a94ac3a7f95ccd169e Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 2 Jan 2019 20:33:14 -0800 Subject: [PATCH 3/3] fixup! fixup! lib,test: remove lib/internal/test/unicode.js --- lib/internal/cli_table.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/internal/cli_table.js b/lib/internal/cli_table.js index 678c7866e640ab..71d322ee9eeed1 100644 --- a/lib/internal/cli_table.js +++ b/lib/internal/cli_table.js @@ -5,11 +5,11 @@ const { removeColors } = require('internal/util'); const HasOwnProperty = Function.call.bind(Object.prototype.hasOwnProperty); // The use of Unicode characters below is the only non-comment use of non-ASCII -// Unicode characters outside of comments in Node.js built-in modules. If they -// are ever removed or rewritten with \u escapes, then a test will need to be -// (re-)added to Node.js core to verify that Unicode characters work in -// built-ins. Otherwise, consumers using Unicode in _third_party_main.js will -// run into problems. Refs: https://github.com/nodejs/node/issues/10673 +// Unicode characters in Node.js built-in modules. If they are ever removed or +// rewritten with \u escapes, then a test will need to be (re-)added to Node.js +// core to verify that Unicode characters work in built-ins. Otherwise, +// consumers using Unicode in _third_party_main.js will run into problems. +// Refs: https://github.com/nodejs/node/issues/10673 const tableChars = { /* eslint-disable node-core/non-ascii-character */ middleMiddle: '─',