Skip to content

Commit 84bf04b

Browse files
Trottitaloacasas
authored andcommitted
test,util: remove lint workarounds
Remove assignments to `SIMD` that are only to pacify ESLint. Instead, use either `global.SIMD` or provide an comment letting ESLint know in cases where `SIMD` is guaranteed to be a defined global identifier. PR-URL: #10785 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Teddy Katz <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Michael Dawson <[email protected]>
1 parent 77cbc26 commit 84bf04b

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

lib/util.js

+3-6
Original file line numberDiff line numberDiff line change
@@ -27,16 +27,13 @@ var simdFormatters;
2727
if (typeof global.SIMD === 'object' && global.SIMD !== null) {
2828
simdFormatters = new Map();
2929

30-
const make = (extractLane, count) => {
31-
return (ctx, value, recurseTimes, visibleKeys, keys) => {
30+
const make =
31+
(extractLane, count) => (ctx, value, recurseTimes, visibleKeys, keys) => {
3232
const output = new Array(count);
3333
for (var i = 0; i < count; i += 1)
3434
output[i] = formatPrimitive(ctx, extractLane(value, i));
3535
return output;
3636
};
37-
};
38-
39-
const SIMD = global.SIMD; // Pacify eslint.
4037

4138
const countPerType = {
4239
Bool16x8: 8,
@@ -52,7 +49,7 @@ if (typeof global.SIMD === 'object' && global.SIMD !== null) {
5249
};
5350

5451
for (const key in countPerType) {
55-
const type = SIMD[key];
52+
const type = global.SIMD[key];
5653
simdFormatters.set(type, make(type.extractLane, countPerType[key]));
5754
}
5855
}

test/parallel/test-util-inspect-simd.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
// Flags: --harmony_simd
2+
/* global SIMD */
23
'use strict';
34

45
require('../common');
56
const assert = require('assert');
67
const inspect = require('util').inspect;
78

8-
const SIMD = global.SIMD; // Pacify eslint.
9-
109
assert.strictEqual(
1110
inspect(SIMD.Bool16x8()),
1211
'Bool16x8 [ false, false, false, false, false, false, false, false ]');

0 commit comments

Comments
 (0)