Ignore:
Timestamp:
Apr 7, 2013, 11:47:20 AM (12 years ago)
Author:
[email protected]
Message:

Inspector should display information about non-object exceptions
https://bugs.webkit.org/show_bug.cgi?id=114123

Reviewed by Adele Peterson.

Source/JavaScriptCore:

Make sure we store the right stack information, even when throwing
a primitive.

  • interpreter/CallFrame.h:

(JSC::ExecState::clearSupplementaryExceptionInfo):
(ExecState):

  • interpreter/Interpreter.cpp:

(JSC::Interpreter::addStackTraceIfNecessary):
(JSC::Interpreter::throwException):

Source/WebCore:

Make use of the stack trace for line information when we're reporting
an exception

  • bindings/js/JSDOMBinding.cpp:

(WebCore::reportException):

LayoutTests:

All these tests throw primitives as exceptions, and now they have source
and line number information

  • fast/dom/exception-getting-event-handler-expected.txt:
  • fast/dom/javascript-url-exception-isolation-expected.txt:
  • fast/dom/nested-script-exceptions-expected.txt:
  • fast/events/onerror-no-constructor-expected.txt:
  • fast/events/window-onerror13-expected.txt:
  • fast/events/window-onerror16-expected.txt:
  • fast/events/window-onerror2-expected.txt:
  • fast/events/window-onerror8-expected.txt:
  • fast/js/uncaught-exception-line-number-expected.txt:
  • fast/sub-pixel/inline-block-with-padding-expected.txt:
  • platform/mac/fast/AppleScript/001-expected.txt:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp

    r147858 r147872  
    762762    Vector<StackFrame> stackTrace;
    763763    getStackTrace(&callFrame->globalData(), stackTrace);
    764    
     764    globalData->exceptionStack = RefCountedArray<StackFrame>(stackTrace);
    765765    if (stackTrace.isEmpty() || !error.isObject())
    766766        return;
     767
    767768    JSObject* errorObject = asObject(error);
    768769    JSGlobalObject* globalObject = 0;
     
    811812
    812813        isInterrupt = isInterruptedExecutionException(exception) || isTerminatedExecutionException(exception);
     814    } else {
     815        if (!callFrame->globalData().exceptionStack.size()) {
     816            Vector<StackFrame> stack;
     817            Interpreter::getStackTrace(&callFrame->globalData(), stack);
     818            callFrame->globalData().exceptionStack = RefCountedArray<StackFrame>(stack);
     819        }
    813820    }
    814821
Note: See TracChangeset for help on using the changeset viewer.