Skip to content

Commit 81e603b

Browse files
Trotttargos
authored andcommitted
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: #36498 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent c3ec90d commit 81e603b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/parallel/test-fs-write.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,10 @@ const fn4 = path.join(tmpdir.path, 'write4.txt');
3636
const expected = 'ümlaut.';
3737
const constants = fs.constants;
3838

39-
/* eslint-disable no-undef */
40-
common.allowGlobals(externalizeString, isOneByteString, x);
39+
const { externalizeString, isOneByteString } = global;
40+
41+
// Account for extra globals exposed by --expose_externalize_string.
42+
common.allowGlobals(externalizeString, isOneByteString, global.x);
4143

4244
{
4345
const expected = 'ümlaut sechzig'; // Must be a unique string.
@@ -78,7 +80,6 @@ common.allowGlobals(externalizeString, isOneByteString, x);
7880
fs.closeSync(fd);
7981
assert.strictEqual(fs.readFileSync(fn, 'utf8'), expected);
8082
}
81-
/* eslint-enable no-undef */
8283

8384
fs.open(fn, 'w', 0o644, common.mustSucceed((fd) => {
8485
const done = common.mustSucceed((written) => {

0 commit comments

Comments
 (0)