node/test/parallel/test-arm-math-illegal-instruction.js
marsonya 67d2262465 test: improve test-arm-math-illegal-instruction
Instead of writing each Math function and keeping track, loop over Math
functions and test each one of them.

PR-URL: https://github.com/nodejs/node/pull/37670
Reviewed-By: Darshan Sen <raisinten@gmail.com>
2021-03-19 12:15:41 +01:00

16 lines
506 B
JavaScript

'use strict';
require('../common');
// This test ensures Math functions don't fail with an "illegal instruction"
// error on ARM devices (primarily on the Raspberry Pi 1)
// See https://github.com/nodejs/node/issues/1376
// and https://code.google.com/p/v8/issues/detail?id=4019
// Iterate over all Math functions
Object.getOwnPropertyNames(Math).forEach((functionName) => {
if (!/[A-Z]/.test(functionName)) {
// The function names don't have capital letters.
Math[functionName](-0.5);
}
});