mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
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: https://github.com/nodejs/node/pull/10785 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Teddy Katz <teddy.katz@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
This commit is contained in:
1 parent
77cbc26a96
commit
84bf04b0c1
2 files changed
+4
-8
No files matched your search
+3
-6
@@ -27,16 +27,13 @@ var simdFormatters;
|
||||
if (typeof global.SIMD === 'object' && global.SIMD !== null) {
|
||||
simdFormatters = new Map();
|
||||
|
||||
const make = (extractLane, count) => {
|
||||
return (ctx, value, recurseTimes, visibleKeys, keys) => {
|
||||
const make =
|
||||
(extractLane, count) => (ctx, value, recurseTimes, visibleKeys, keys) => {
|
||||
const output = new Array(count);
|
||||
for (var i = 0; i < count; i += 1)
|
||||
output[i] = formatPrimitive(ctx, extractLane(value, i));
|
||||
return output;
|
||||
};
|
||||
};
|
||||
|
||||
const SIMD = global.SIMD; // Pacify eslint.
|
||||
|
||||
const countPerType = {
|
||||
Bool16x8: 8,
|
||||
@@ -52,7 +49,7 @@ if (typeof global.SIMD === 'object' && global.SIMD !== null) {
|
||||
};
|
||||
|
||||
for (const key in countPerType) {
|
||||
const type = SIMD[key];
|
||||
const type = global.SIMD[key];
|
||||
simdFormatters.set(type, make(type.extractLane, countPerType[key]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
// Flags: --harmony_simd
|
||||
/* global SIMD */
|
||||
'use strict';
|
||||
|
||||
require('../common');
|
||||
const assert = require('assert');
|
||||
const inspect = require('util').inspect;
|
||||
|
||||
const SIMD = global.SIMD; // Pacify eslint.
|
||||
|
||||
assert.strictEqual(
|
||||
inspect(SIMD.Bool16x8()),
|
||||
'Bool16x8 [ false, false, false, false, false, false, false, false ]');
|
||||
|
||||
Reference in new issue
Block a user