You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The SyntaxError type is reserved for errors raised by the host runtime (i.e. JavaScript), not errors raised by user code. Using SyntaxError to signal errors in inputs to the Lua parser causes problems in some engines, like the one worked around in 8536fdf.
Fixing this will be a breaking change, given that some downstream users already rely on the error to be an instance of SyntaxError, e.g. the ACE editor.
I think I am going to solve this and #9 in one go. In other words, I will create a callback that shall receive diagnostics from the parser as a structured object; if the callback is absent, the parser will fall back to throwing a SyntaxError as before.
As of 6f8a7ea, the error type thrown by the parser is exported as a SyntaxError export. Users are encouraged to use that export instead of directly referring to the engine’s SyntaxError to detect errors thrown by luaparse, to minimise future breakage.
The
SyntaxError
type is reserved for errors raised by the host runtime (i.e. JavaScript), not errors raised by user code. UsingSyntaxError
to signal errors in inputs to the Lua parser causes problems in some engines, like the one worked around in 8536fdf.Fixing this will be a breaking change, given that some downstream users already rely on the error to be an instance of
SyntaxError
, e.g. the ACE editor.Related PR: #33.
The text was updated successfully, but these errors were encountered: