Ignore:
Timestamp:
Jul 18, 2008, 6:44:24 PM (17 years ago)
Author:
[email protected]
Message:

Bug 18774: SQUIRRELFISH: print meaningful error messages <https://bugs.webkit.org/show_bug.cgi?id=18774>
<rdar://problem/5769353> SQUIRRELFISH: JavaScript error messages are missing informative text

Reviewed by Cameron Zwarich

Add support for decent error messages in JavaScript. This patch achieves this by providing
ensuring the common errors and exceptions have messages that provide the text of expression
that trigger the exception. In addition it attaches a number of properties to the exception
object detailing where in the source the expression came from.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/JSNotAnObject.h

    r35027 r35245  
    3434namespace KJS {
    3535
     36    class JSNotAnObjectErrorStub : public JSObject {
     37    public:
     38        JSNotAnObjectErrorStub(bool isNull)
     39            : m_isNull(isNull)
     40        {
     41        }
     42        bool isNull() const { return m_isNull; }
     43        bool isNotAnObjectErrorStub() const { return true; }
     44    private:
     45        bool m_isNull;
     46    };
     47   
    3648    // This unholy class is used to allow us to avoid multiple exception checks
    3749    // in certain SquirrelFish opcodes -- effectively it just silently consumes
     
    3951    class JSNotAnObject : public JSObject {
    4052    public:
    41         JSNotAnObject(JSObject* exception)
     53        JSNotAnObject(JSNotAnObjectErrorStub* exception)
    4254            : m_exception(exception)
    4355        {
     
    6880        virtual void getPropertyNames(ExecState*, PropertyNameArray&);
    6981
    70         JSObject* m_exception;
     82        JSNotAnObjectErrorStub* m_exception;
    7183    };
    7284
Note: See TracChangeset for help on using the changeset viewer.