Skip to content
  • joepeck@webkit.org's avatar
    ScriptExecutionContext log exception should include a column number · bdec8ed0
    joepeck@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=114315
    
    Reviewed by Oliver Hunt.
    
    Source/WebCore:
    
    Test: inspector/console/console-exception-stack-traces.html
    
    * bindings/js/ScriptCallStackFactory.h:
    * bindings/js/ScriptCallStackFactory.cpp:
    (WebCore::createScriptCallStackFromException):
    Generate a ScriptCallStack from an exception. Use the vm.exceptionStack
    if available, and fallback to the exception object where needed.
    
    * bindings/js/JSDOMBinding.cpp:
    (WebCore::reportException):
    Always include a non-empty call stack with exceptions.
    Where not provided, fallback to the exception object.
    
    * dom/Document.h:
    * dom/Document.cpp:
    (WebCore::Document::logExceptionToConsole):
    * dom/ScriptExecutionContext.h:
    * dom/ScriptExecutionContext.cpp:
    (WebCore::ScriptExecutionContext::PendingException::PendingException):
    (ScriptExecutionContext::PendingException):
    (WebCore::ScriptExecutionContext::reportException):
    * workers/DefaultSharedWorkerRepository.cpp:
    * workers/SharedWorkerContext.cpp:
    (WebCore::SharedWorkerContext::logExceptionToConsole):
    * workers/SharedWorkerContext.h:
    * workers/WorkerContext.cpp:
    (WebCore::WorkerContext::logExceptionToConsole):
    * workers/WorkerContext.h:
    * workers/WorkerMessagingProxy.cpp:
    (WebCore::WorkerExceptionTask::performTask):
    Plumb columnNumber through as needed.
    
    LayoutTests:
    
    * inspector/console/console-exception-stack-traces-expected.txt: Added.
    * inspector/console/console-exception-stack-traces.html: Added.
    Verifies that exceptions have stack traces and match a console.trace stack.
    
    * http/tests/inspector-enabled/console-exception-while-no-inspector-expected.txt: Removed.
    * http/tests/inspector-enabled/console-exception-while-no-inspector.html: Removed.
    We now save exception backtraces even if the inspector is not open.
    
    * fast/dom/javascript-url-exception-isolation-expected.txt
    * fast/events/remove-target-with-shadow-in-drag-expected.txt
    * fast/events/set-attribute-listener-window-onerror-crash-expected.txt
    * inspector-protocol/media-query-listener-exception-expected.txt:
    * inspector/console/console-uncaught-exception-expected.txt:
    * inspector/console/console-uncaught-exception-in-eval-expected.txt:
    Update results that now include backtraces or different data. Most better, some worse.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@149131 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    bdec8ed0