pico-engine
pico-engine copied to clipboard
Better error reporting for compiled code
Catch JS errors in compiled code and use source-maps to get the KRL line and excerpt
i.e. calling a function that is not defined, or having a "native" module throw an error
example, this function which calls filter
without passing in a function: vehicles = function() { Subscriptions:getSubscriptions().filter(v,k){ v{"attributes"}{"subscriber_role"} == "vehicle" } }
Once this work begins, I think it should be labeled 'Ongoing' rather than 'Working', at least until this can be split into more specific issues.
The standard library has better error reporting now (with even better planned). Library modules are next. One remaining scope is user-defined modules.
As of 0.43
the compiler emits line/col specific error messages. There are more compiler checks that can be added.
The runtime error handling should use source-maps to point to the location in the krl source file.