mojira.dev
MCPE-145798

"isNaN" not working in GameTest framework

For some odd reason, the function "isNaN" no longer works in GameTest scripts as of 1.17.40. It always returns false, even the value passed in is `NaN`.

Steps to Reproduce:

  1. Make a behaviour pack with a Gametest script that does the followings (Updated for 1.18.10):

    world.getDimension('overworld').runCommand(`say ${isNaN(NaN)}`);
  1. Import the pack to a world (Gametest framework enabled) and run it.

  

Observed Results:

Chat says

false

Expected Results:

Chat should say

true

 

Notes:

Fortunately this can worked around by comparing the value to itself, but it would be great if a common function such as this works as intended.

Comments 2

Thank you for your report!
However, this issue has been temporarily closed as Awaiting Response

Is this still an issue in the latest version? If so, can you please add it to the affected versions (or mention it if you are not the reporter).

Also, just a reminder, to make your bug report as effective as possible, please try and include the following steps to reproduce the problem:

Steps to Reproduce:
1.
2.
3.

Observed Results:
(Briefly describe what happens)

Expected Results:
(Briefly describe what should happen)

If your ticket does not look like the example given here, then it's likely to be closed as incomplete.

This ticket will automatically reopen when you reply.

Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki

Tested it in 1.18.10. Still prints false from `isNaN(NaN)`.

SIsilicon

(Unassigned)

819230

Confirmed

Android

Android 11

1.17.40, 1.18.10

Retrieved