mirror of
https://github.com/nodejs/node.git
synced 2025-05-01 08:42:45 +00:00

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>
16 lines
506 B
JavaScript
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);
|
|
}
|
|
});
|