Skip to content

Commit 85fab9f

Browse files
authored
Avoid needless string attribute lookups JS tools. NFC (#18615)
Once apon a time maybe this was needed for some kind of closure reason? But even then, I can't imagine why, given the correct node externs.
1 parent 51cd063 commit 85fab9f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

tools/lz4-compress.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@
99
const fs = require('fs');
1010
const path = require('path');
1111

12-
const arguments_ = process['argv'].slice(2);
12+
const arguments_ = process.argv.slice(2);
1313
const debug = false;
1414

1515
function print(x) {
16-
process['stdout'].write(x + '\n');
16+
process.stdout.write(x + '\n');
1717
}
1818

1919
function printErr(x) {
20-
process['stderr'].write(x + '\n');
20+
process.stderr.write(x + '\n');
2121
}
2222

2323
function read(filename, binary) {
24-
filename = path['normalize'](filename);
25-
let ret = fs['readFileSync'](filename);
24+
filename = path.normalize(filename);
25+
let ret = fs.readFileSync(filename);
2626
if (ret && !binary) ret = ret.toString();
2727
return ret;
2828
}

tools/preprocessor.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ const fs = require('fs');
1818
const path = require('path');
1919
global.vm = require('vm');
2020

21-
const arguments_ = process['argv'].slice(2);
21+
const arguments_ = process.argv.slice(2);
2222
const debug = false;
2323

2424
global.print = function(x) {
25-
process['stdout'].write(x + '\n');
25+
process.stdout.write(x + '\n');
2626
};
2727
global.printErr = function(x) {
28-
process['stderr'].write(x + '\n');
28+
process.stderr.write(x + '\n');
2929
};
3030

3131
global.assert = require('assert');

0 commit comments

Comments
 (0)