test: specify global object for globals

Be explicit about using `global.externalizeString()` etc. in
test-fs-write instead of disabling the `no-undef` ESLint rule.

PR-URL: https://github.com/nodejs/node/pull/36498
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Rich Trott authored and Michaël Zasso committed 2021-05-01 09:44:42 +02:00
1 parent c32c109450
commit 5ef609af3e
1 file changed
+4 -3
+4 -3
View File
@@ -36,8 +36,10 @@ const fn4 = path.join(tmpdir.path, 'write4.txt');
const expected = 'ümlaut.';
const constants = fs.constants;
/* eslint-disable no-undef */
common.allowGlobals(externalizeString, isOneByteString, x);
const { externalizeString, isOneByteString } = global;
// Account for extra globals exposed by --expose_externalize_string.
common.allowGlobals(externalizeString, isOneByteString, global.x);
{
const expected = 'ümlaut sechzig'; // Must be a unique string.
@@ -78,7 +80,6 @@ common.allowGlobals(externalizeString, isOneByteString, x);
fs.closeSync(fd);
assert.strictEqual(fs.readFileSync(fn, 'utf8'), expected);
}
/* eslint-enable no-undef */
fs.open(fn, 'w', 0o644, common.mustSucceed((fd) => {
const done = common.mustSucceed((written) => {