I hit this while passing a function with an invalid return -- e.g. "[1].map(x => x.key)" would output [undefined], but trying to print this on the GCLI crashes.
I'm not sure what the right behaviour is here: printing null and the class name seem the most useful, but raising the exception is probably correct. Any thoughts?
Code:
> js null
Returned: null
> js undefined
Returned: org.mozilla.javascript.Undefined@7fadecaf
> js [null]
Unexpected error, debug log printed.
> js [1, null]
Returned: aggregate float [2]
0 => 1.0
Unexpected error, debug log printed.
> js dump(null)
Script exception: Could not coerce argument to valid ASH value. (command line#1)
Returned: null
> js dump(undefined)
org.mozilla.javascript.Undefined@7fadecaf
Returned: null
> js [1,,]
Returned: aggregate float [2]
0 => 1.0
Unexpected error, debug log printed.
> js [,1,]
Unexpected error, debug log printed.
I'm not sure what the right behaviour is here: printing null and the class name seem the most useful, but raising the exception is probably correct. Any thoughts?