[Webkit-unassigned] [Bug 49488] New: Only add source specific information to exceptions in Interpreter::throwException

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 12 20:24:30 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=49488

           Summary: Only add source specific information to exceptions in
                    Interpreter::throwException
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: JavaScriptCore
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: barraclough at apple.com


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.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list