EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-01-2014
01:06 PM
[fixed] eval("return") = RebootSystem()
My latest YAWRR: eval("return") restarts the player. So short, at 14 chars it kills the fun of future code-golfing for the shortest reboot sequence.
How the heck do i find these, you may ask. Well, i was debugging some code and it occurred to me (BASIC childhood memories) that i can exit the nested execution by just typing "return" in the console, and so i tried:
Looking at the backtrace, i saw something suspicious. I doubt is related - likely a separate buglet - but will mention it just in case. One of the nested functions was shown with the wrong signature:
I am having difficulty finding where optional params are documented in RTFM... but somehow know of them; was it from examples only?!
How the heck do i find these, you may ask. Well, i was debugging some code and it occurred to me (BASIC childhood memories) that i can exit the nested execution by just typing "return" in the console, and so i tried:
BrightScript Debugger> returnFor some reason it popped 2 nested levels and the error shows at the 3rd/top, in main(). What is this E2 error code, i could not find it in bslBrightScriptErrorCodes()?
UNKNOWN ERROR (runtime error &he2) in ...AATjqxRj/pkg:/source/main.brs(24)
BrightScript Debugger> Connection closed by foreign host.
Looking at the backtrace, i saw something suspicious. I doubt is related - likely a separate buglet - but will mention it just in case. One of the nested functions was shown with the wrong signature:
The actual function definition is "sub Test(aa=invalid as Object):" - its return is void, so it should have been shown as
...
Function test() As Object
file/line: /tmp/plugin/LDAAAAcGXdAR/pkg:/source/main.brs(27)
...
Function test(aa As Object) As VoidI think it was the optional param (=invalid) that confuses the dumper.
I am having difficulty finding where optional params are documented in RTFM... but somehow know of them; was it from examples only?!
1 REPLY 1
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-28-2014
09:08 PM
Re: eval("return") = RebootSystem()
FWIW, seems to have been quietly fixed: eval("return") does not cause reboot anymore on current fw 3 and 5.