/ Errors


Upon error in a try, catch is passed a string rather than an object, eg.

try { badcall(); } catch(e) { puts("Note e is a string: "+e); }

Error Diagnostics

Jsi does not generate tracebacks upon error. Instead it provides gcc style warnings that contain the file and line number. For example:

var x = 1;

This results in the following diagnostic:

/home/user/myjsi/foo.js:2: error: 'foo', sub-commands are: Array Boolean Date File 
   Function Interp JSON Math Number Object RegExp Sqlite String Websocket alert 
   assert clearInterval console decodeURI encodeURI exit file format include info
   isFinite isNaN load parseFloat parseInt puts quote setInterval setTimeout signal
   sys util zvfs.

The file and line number is reported, as well as an enumeration of known commands in the given scope. This allows errors to be parsable by IDE's.

Method Introspection

Upon error, an objects sub-methods are enumerated, if possible:

# Info.xx()
error: 'info', sub-commands are: cmds data error events executable funcs
    named platform revisions script vars version.    (at or near string "xx")

Displayed Arguments

And arguments to builtin methods part of the diagnostic:

# format()
error: missing args, expected "format(format?,arg,arg?)"