test: improve test-arm-math-illegal-instruction.js - #37670
Conversation
RaisinTen
left a comment
There was a problem hiding this comment.
What do you think about doing something like this instead:
Object.getOwnPropertyNames(Math).forEach(function (functionName) {
if (!/[A-Z]/.test(functionName)) {
// The function names don't have capital letters.
Math[functionName](-0.5);
}
});That way, we don't have to manually keep a track of all the function names.
This seems like a great idea. |
|
I don't think that will be a problem given the purpose of the test: |
That sounds fair. The functions that require more than one parameters are simply returning |
This seems a great solution to me. Let's wait for more reviews. |
|
+1 on @RaisinTen idea. FWIW we could use |
|
New changes made as per @RaisinTen's idea. |
Instead of writing each Math function and keeping track, loop over Math functions and test each one of them. PR-URL: #37670 Reviewed-By: Darshan Sen <raisinten@gmail.com>
|
Landed in 67d2262 |
Instead of writing each Math function and keeping track, loop over Math functions and test each one of them. PR-URL: #37670 Reviewed-By: Darshan Sen <raisinten@gmail.com>
Instead of writing each Math function and keeping track, loop over Math functions and test each one of them. PR-URL: #37670 Reviewed-By: Darshan Sen <raisinten@gmail.com>
add
Math.clz32(x)to the test