Skip to content

Fix SyntaxError stack traces

Philip Chimento requested to merge ptomato/gjs:584-syntax-error-stacks into master

Previously, we would not show stack traces for SyntaxError in the logs. This was probably based on the assumption that SyntaxError is thrown when parsing a file, so there isn't really a location where it's thrown from, and we should display the location based on error.fileName, error.lineNumber, and error.columnNumber instead. However, a SyntaxError can be thrown from user code as well! import(), JSON.parse(), and Reflect.parse() are examples of where this happens. So, now we display both the location of the faulty syntax, as well as the stack trace if there is one.

Closes: #584 (closed)

Merge request reports