Victor_Dev
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-16-2021
06:37 AM
Roku pkg submission error: Eval is deprecated
I have tried to submit the package but get the error that "Eval is deprecated". Below are 2 methods that uses eval. Do you know how to fix it? I am new to Roku app development. As per my reading, Roku suggested to use roXMLElement.parse() or parseJSON() instead of Eval(). But I am confused.
Function rodash_max_(a,b)
max = invalid
result = eval("if a >= b then: max = a: else: max = b: end if")
return max
End Function
Function rodash_min_(a,b)
min = invalid
result = eval("if a <= b then: min = a: else: min = b: end if")
return min
1 REPLY 1
NB_
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2021
08:47 PM
Re: Roku pkg submission error: Eval is deprecated
why are you trying to use `eval()` here?
if trying to address case when `a` and `b` may not be comparable, use `try ... catch ... end try`. Either way you'll have to figure out what fn should return in that case