GNOME Bugzilla – Bug 722285
logError: format syntax error differently
Last modified: 2014-01-15 21:40:23 UTC
The stack of a syntax error shows the importing module, not the imported one, so the information of which line has the error is lost. Also, syntax errors are definitely programmer errors, and should be criticals rather than warnings.
Created attachment 266376 [details] [review] logError: format syntax error differently
Review of attachment 266376 [details] [review]: ::: gjs/context.cpp @@ +778,3 @@ + "Script evaluation succeeded"); + + if (gjs_log_exception(js_context->context)) { We'll already return FALSE from gjs_eval_with_scope for this -- we have a JS_IsExceptionPending. ::: gjs/jsapi-util.cpp @@ +505,3 @@ utf8_message = NULL; + if (!is_syntax) { A comment here about why syntax errors are handled specially would be nice. Would also be nice if this was if (is_syntax) {} else {}
(In reply to comment #2) > Review of attachment 266376 [details] [review]: > > ::: gjs/context.cpp > @@ +778,3 @@ > + "Script evaluation succeeded"); > + > + if (gjs_log_exception(js_context->context)) { > > We'll already return FALSE from gjs_eval_with_scope for this -- we have a > JS_IsExceptionPending. Speaking of which, I believe you introduced a regression with that, I keep getting SEGV if a script throws while loading.
Pushed after addressing the comments. Attachment 266376 [details] pushed as af1e119 - logError: format syntax error differently