rokucommunity / brs

An interpreter for the BrightScript language that runs on non-Roku platforms.
MIT License
4 stars 2 forks source link

String function `val()` not behaving as in a Roku device #2

Closed lvcabral closed 1 year ago

lvcabral commented 1 year ago

Two issues found, first non numeric numbers are returning NaN instead of 0 and the function should recognize the prefix 0x for hexadecimals.

Running this code:

print val("1")
print val("0xFF")
print val("AA", 16)
print val("notanumber")

In Roku we get:

1
255
170
0

With brs we get:

1
0
170
NaN