Mojira Archive
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.

Fixed

Roujel Williams

2021-10-23, 02:11 AM

2024-08-14, 02:14 AM

2024-08-14, 02:14 AM

1

0

Confirmed

819230

1.17.40, 1.18.10

-