A script with only three characters that crashes lightning:
A script with only three characters that crashes lightning:
/{/
It seems that regexp Pattern exceptions are not caught, and directly crashes lightning (the app log outputs the error)
But a more strange thing is that, if you create a shortcut to launch this script nothing happens(nor even in the log), but if you run it from an item/container/customMenu then it crash.
]]>
< ![CDATA[
I guess the error is caught in onNewIntent(), but not if the call goes directly to wherever scripts are executed .
]]>
< ![CDATA[
LOL, there is only one person who could find this bug. 😉 good catch TrianguloY
]]>
< ![CDATA[
Well, anybody with the necessity of replacing the ‘{‘ character of a string without remembering that it is a special character that needs escape could have discover it too 😉
“{}”.replace(/{/g,”{\n”); //bad
“{}”.replace(/\{/g,”{\n”); //good
]]>