Three types of source location information are added to errors. (1) Divot information. This was added with the intention of using it to provide better source highlighting in the inspector. We may still want to do so, but we probably should not be exposing these values in a manner visible to user scripts – only through an internal C++ interface. The code adding divot properties to objects has been removed. (2) Line number information. Line number information is presently sometimes added at the point the exception is created, and sometimes added at the point the exception passes through throwException. Change this so that throwException has the sole responsibility for adding line number and source file information. (3) Source snippets in the message of certain type errors (e.g. 'doc' in `Result of expression 'doc' [undefined] is not an object.`). These messages are currently created at the point the exceptions is raised. Instead reformat the message such that the source snippet is located at the end (`Result of expression 'b1' [undefined] is not an object.` -> `'undefined' is not an object (evaluating 'b1.property')`), and append these to the message at the in throw Exception. This presents a number of advantages: i) we no longer need to have source location information to create these TypeErrors. ii) we can chose to append source location information in other error messages, including those where passing source location to the point of construction would be inconvenient. iii) we can chose in future to omit to append source location information when running in a non-debug mode. This also cleans up some error output, e.g. removing double brackets ('[[]]') around objects in output, removing double periods (..) at end of lines, and adding slightly more context to some errors.
Created attachment 73813 [details] Code changes
Created attachment 73814 [details] Test changes
Attachment 73814 [details] did not pass style-queue: Failed to run "['WebKitTools/Scripts/check-webkit-style', '--diff-files']" exit_code: 1 Total errors found: 0 in 0 files If any of these errors are false positives, please file a bug against check-webkit-style.
Created attachment 73815 [details] Test changes II (file upload failed)
Comment on attachment 73813 [details] Code changes r=me
Comment on attachment 73815 [details] Test changes II (file upload failed) r=me
Committed revision 72050.