Changeset 149131 in webkit


Ignore:
Timestamp:
Apr 25, 2013 12:31:50 PM (11 years ago)
Author:
Joseph Pecoraro
Message:

ScriptExecutionContext log exception should include a column number
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.

Location:
trunk
Files:
2 added
2 deleted
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r149126 r149131  
     12013-04-25  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        ScriptExecutionContext log exception should include a column number
     4        https://bugs.webkit.org/show_bug.cgi?id=114315
     5
     6        Reviewed by Oliver Hunt.
     7
     8        * inspector/console/console-exception-stack-traces-expected.txt: Added.
     9        * inspector/console/console-exception-stack-traces.html: Added.
     10        Verifies that exceptions have stack traces and match a console.trace stack.
     11
     12        * http/tests/inspector-enabled/console-exception-while-no-inspector-expected.txt: Removed.
     13        * http/tests/inspector-enabled/console-exception-while-no-inspector.html: Removed.
     14        We now save exception backtraces even if the inspector is not open.
     15
     16        * fast/dom/javascript-url-exception-isolation-expected.txt
     17        * fast/events/remove-target-with-shadow-in-drag-expected.txt
     18        * fast/events/set-attribute-listener-window-onerror-crash-expected.txt
     19        * inspector-protocol/media-query-listener-exception-expected.txt:
     20        * inspector/console/console-uncaught-exception-expected.txt:
     21        * inspector/console/console-uncaught-exception-in-eval-expected.txt:
     22        Update results that now include backtraces or different data. Most better, some worse.
     23
    1242013-04-25  Ryosuke Niwa  <rniwa@webkit.org>
    225
  • trunk/LayoutTests/fast/dom/javascript-url-exception-isolation-expected.txt

    r147872 r149131  
    11CONSOLE MESSAGE: line 1: 42
    2 CONSOLE MESSAGE: line 1: SyntaxError: Unexpected token '<'
     2CONSOLE MESSAGE: line 18: SyntaxError: Unexpected token '<'
    33Exceptions thrown in javascript URLs should not propagate to the main script.
    44
  • trunk/LayoutTests/fast/events/remove-target-with-shadow-in-drag-expected.txt

    r134618 r149131  
    1 CONSOLE MESSAGE: line 34: NotFoundError: DOM Exception 8: An attempt was made to reference a Node in a context where it does not exist.
    2 CONSOLE MESSAGE: line 34: NotFoundError: DOM Exception 8: An attempt was made to reference a Node in a context where it does not exist.
     1CONSOLE MESSAGE: line 35: NotFoundError: DOM Exception 8: An attempt was made to reference a Node in a context where it does not exist.
     2CONSOLE MESSAGE: line 35: NotFoundError: DOM Exception 8: An attempt was made to reference a Node in a context where it does not exist.
    33PASS. DRT didn't crash.
  • trunk/LayoutTests/fast/events/set-attribute-listener-window-onerror-crash-expected.txt

    r127129 r149131  
    1 CONSOLE MESSAGE: line 16: SyntaxError: Unexpected token ';'
     1CONSOLE MESSAGE: line 15: SyntaxError: Unexpected token ';'
    22Test passes if it does not crash.
  • trunk/LayoutTests/inspector-protocol/media-query-listener-exception-expected.txt

    r138010 r149131  
    1 CONSOLE MESSAGE: line 13:
    2 CONSOLE MESSAGE: line 13:
     1CONSOLE MESSAGE: line 13: ReferenceError: Can't find variable: objectThatDoesNotExist
     2CONSOLE MESSAGE: line 13: ReferenceError: Can't find variable: objectThatDoesNotExist
    33Test that uncaught exception in MediaQueryListListener will be reported to the console. On success you should see two exceptions in the listener logged to the console (first time when the media type is overridden and second - when they are restored). Bug 105162.
    44
  • trunk/LayoutTests/inspector/console/console-uncaught-exception-expected.txt

    r127705 r149131  
    55
    66
    7 Error: Exception in inline script. resources/uncaught-in-iframe.html:18
    8 Error: Exception in 'load' event listener. resources/uncaught-in-iframe.html:11
    9 Error: Exception in setTimeout callback. uncaught-in-iframe.html:6
     7Error: Exception in inline script. resources/uncaught-in-iframe.html:18a resources/uncaught-in-iframe.html:18b resources/uncaught-in-iframe.html:23
     8Error: Exception in 'load' event listener. resources/uncaught-in-iframe.html:11f resources/uncaught-in-iframe.html:11(anonymous function) resources/uncaught-in-iframe.html:13
     9Error: Exception in setTimeout callback. uncaught-in-iframe.html:6bar uncaught-in-iframe.html:6(anonymous function) uncaught-in-iframe.html:8
    1010
  • trunk/LayoutTests/inspector/console/console-uncaught-exception-in-eval-expected.txt

    r78535 r149131  
    44
    55Page reloaded.
    6 Error: Exception in eval.
     6Error: Exception in eval. undefined:4b undefined:4aevalSource
    77
  • trunk/Source/WebCore/ChangeLog

    r149129 r149131  
     12013-04-25  Joseph Pecoraro  <pecoraro@apple.com>
     2
     3        ScriptExecutionContext log exception should include a column number
     4        https://bugs.webkit.org/show_bug.cgi?id=114315
     5
     6        Reviewed by Oliver Hunt.
     7
     8        Test: inspector/console/console-exception-stack-traces.html
     9
     10        * bindings/js/ScriptCallStackFactory.h:
     11        * bindings/js/ScriptCallStackFactory.cpp:
     12        (WebCore::createScriptCallStackFromException):
     13        Generate a ScriptCallStack from an exception. Use the vm.exceptionStack
     14        if available, and fallback to the exception object where needed.
     15
     16        * bindings/js/JSDOMBinding.cpp:
     17        (WebCore::reportException):
     18        Always include a non-empty call stack with exceptions.
     19        Where not provided, fallback to the exception object.
     20
     21        * dom/Document.h:
     22        * dom/Document.cpp:
     23        (WebCore::Document::logExceptionToConsole):
     24        * dom/ScriptExecutionContext.h:
     25        * dom/ScriptExecutionContext.cpp:
     26        (WebCore::ScriptExecutionContext::PendingException::PendingException):
     27        (ScriptExecutionContext::PendingException):
     28        (WebCore::ScriptExecutionContext::reportException):
     29        * workers/DefaultSharedWorkerRepository.cpp:
     30        * workers/SharedWorkerContext.cpp:
     31        (WebCore::SharedWorkerContext::logExceptionToConsole):
     32        * workers/SharedWorkerContext.h:
     33        * workers/WorkerContext.cpp:
     34        (WebCore::WorkerContext::logExceptionToConsole):
     35        * workers/WorkerContext.h:
     36        * workers/WorkerMessagingProxy.cpp:
     37        (WebCore::WorkerExceptionTask::performTask):
     38        Plumb columnNumber through as needed.
     39
    1402013-04-25  Gregg Tavares  <gman@chromium.org>
    241
  • trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp

    r148696 r149131  
    3434#include "JSExceptionBase.h"
    3535#include "ScriptCallStack.h"
     36#include "ScriptCallStackFactory.h"
    3637#include <interpreter/Interpreter.h>
    3738#include <runtime/DateInstance.h>
     
    147148
    148149    Interpreter::ErrorHandlingMode mode(exec);
    149     String errorMessage = exception.toString(exec)->value(exec);
    150     int lineNumber = 0;
    151     String exceptionSourceURL;
    152 
    153     RefCountedArray<StackFrame> stackTrace = exec->vm().exceptionStack;
     150
     151    RefPtr<ScriptCallStack> callStack(createScriptCallStackFromException(exec, exception, ScriptCallStack::maxCallStackSizeToCapture));
    154152    exec->clearException();
    155153    exec->clearSupplementaryExceptionInfo();
    156 
    157     if (exception.isObject()) {
    158         JSObject* exceptionObject = exception.toObject(exec);
    159         lineNumber = exceptionObject->get(exec, Identifier(exec, "line")).toInt32(exec);
    160         exceptionSourceURL = exceptionObject->get(exec, Identifier(exec, "sourceURL")).toString(exec)->value(exec);
    161     } else if (stackTrace.size()) {
    162         lineNumber = stackTrace[0].line();
    163         exceptionSourceURL = stackTrace[0].friendlySourceURL();
    164     }
    165 
    166     if (ExceptionBase* exceptionBase = toExceptionBase(exception))
    167         errorMessage = exceptionBase->message() + ": "  + exceptionBase->description();
    168154
    169155    JSDOMGlobalObject* globalObject = jsCast<JSDOMGlobalObject*>(exec->lexicalGlobalObject());
     
    172158            return;
    173159    }
     160
     161    int lineNumber = 0;
     162    int columnNumber = 0;
     163    String exceptionSourceURL;
     164    if (callStack->size()) {
     165        const ScriptCallFrame& frame = callStack->at(0);
     166        lineNumber = frame.lineNumber();
     167        columnNumber = frame.columnNumber();
     168        exceptionSourceURL = frame.sourceURL();
     169    } else {
     170        // There may not be an exceptionStack for a <script> SyntaxError. Fallback to getting at least the line and sourceURL from the exception.
     171        JSObject* exceptionObject = exception.toObject(exec);
     172        JSValue lineValue = exceptionObject->getDirect(exec->vm(), Identifier(exec, "line"));
     173        lineNumber = lineValue && lineValue.isNumber() ? int(lineValue.toNumber(exec)) : 0;
     174        JSValue sourceURLValue = exceptionObject->getDirect(exec->vm(), Identifier(exec, "sourceURL"));
     175        exceptionSourceURL = sourceURLValue && sourceURLValue.isString() ? sourceURLValue.toString(exec)->value(exec) : ASCIILiteral("undefined");
     176    }
     177
     178    String errorMessage;
     179    if (ExceptionBase* exceptionBase = toExceptionBase(exception))
     180        errorMessage = exceptionBase->message() + ": "  + exceptionBase->description();
     181    else {
     182        // FIXME: <http://webkit.org/b/115087> Web Inspector: WebCore::reportException should not evaluate JavaScript handling exceptions
     183        // If this is a custon exception object, call toString on it to try and get a nice string representation for the exception.
     184        errorMessage = exception.toString(exec)->value(exec);
     185        exec->clearException();
     186        exec->clearSupplementaryExceptionInfo();
     187    }
     188
    174189    ScriptExecutionContext* scriptExecutionContext = globalObject->scriptExecutionContext();
    175     scriptExecutionContext->reportException(errorMessage, lineNumber, exceptionSourceURL, 0, cachedScript);
     190    scriptExecutionContext->reportException(errorMessage, lineNumber, columnNumber, exceptionSourceURL, callStack->size() ? callStack : 0, cachedScript);
    176191}
    177192
  • trunk/Source/WebCore/bindings/js/ScriptCallStackFactory.cpp

    r148696 r149131  
    9191}
    9292
     93PassRefPtr<ScriptCallStack> createScriptCallStackFromException(JSC::ExecState* exec, JSC::JSValue& exception, size_t maxStackSize)
     94{
     95    Vector<ScriptCallFrame> frames;
     96    RefCountedArray<StackFrame> stackTrace = exec->vm().exceptionStack;
     97    for (size_t i = 0; i < stackTrace.size() && i < maxStackSize; i++) {
     98        if (!stackTrace[i].callee && frames.size())
     99            break;
     100
     101        String functionName = stackTrace[i].friendlyFunctionName(exec);
     102        frames.append(ScriptCallFrame(functionName, stackTrace[i].sourceURL, stackTrace[i].line(), stackTrace[i].column()));
     103    }
     104
     105    // FIXME: <http://webkit.org/b/115087> Web Inspector: WebCore::reportException should not evaluate JavaScript handling exceptions
     106    // Fallback to getting at least the line and sourceURL from the exception if it has values and the exceptionStack doesn't.
     107    if (frames.size() > 0) {
     108        const ScriptCallFrame& firstCallFrame = frames.first();
     109        JSObject* exceptionObject = exception.toObject(exec);
     110        if (exception.isObject() && firstCallFrame.sourceURL().isEmpty()) {
     111            JSValue lineValue = exceptionObject->getDirect(exec->vm(), Identifier(exec, "line"));
     112            int lineNumber = lineValue && lineValue.isNumber() ? int(lineValue.toNumber(exec)) : 0;
     113            JSValue sourceURLValue = exceptionObject->getDirect(exec->vm(), Identifier(exec, "sourceURL"));
     114            String exceptionSourceURL = sourceURLValue && sourceURLValue.isString() ? sourceURLValue.toString(exec)->value(exec) : ASCIILiteral("undefined");
     115            frames[0] = ScriptCallFrame(firstCallFrame.functionName(), exceptionSourceURL, lineNumber, 0);
     116        }
     117    }
     118
     119    return ScriptCallStack::create(frames);
     120}
     121
    93122PassRefPtr<ScriptCallStack> createScriptCallStackForConsole(JSC::ExecState* exec)
    94123{
  • trunk/Source/WebCore/bindings/js/ScriptCallStackFactory.h

    r130021 r149131  
    3333
    3434#include <wtf/Forward.h>
     35#include <wtf/RefCountedArray.h>
    3536
    3637namespace JSC {
    3738class ExecState;
     39class JSValue;
     40struct StackFrame;
    3841}
    3942
     
    4548PassRefPtr<ScriptCallStack> createScriptCallStack(size_t maxStackSize, bool emptyStackIsAllowed);
    4649PassRefPtr<ScriptCallStack> createScriptCallStack(JSC::ExecState*, size_t maxStackSize);
     50PassRefPtr<ScriptCallStack> createScriptCallStackFromException(JSC::ExecState*, JSC::JSValue& exception, size_t maxStackSize);
    4751PassRefPtr<ScriptCallStack> createScriptCallStackForConsole(JSC::ExecState*);
    4852PassRefPtr<ScriptArguments> createScriptArguments(JSC::ExecState*, unsigned skipArgumentCount);
  • trunk/Source/WebCore/dom/Document.cpp

    r149125 r149131  
    26562656}
    26572657
    2658 void Document::logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, PassRefPtr<ScriptCallStack> callStack)
    2659 {
    2660     addMessage(JSMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber, 0, callStack);
     2658void Document::logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack> callStack)
     2659{
     2660    addMessage(JSMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber, columnNumber, callStack);
    26612661}
    26622662
  • trunk/Source/WebCore/dom/Document.h

    r149125 r149131  
    11061106
    11071107    virtual EventTarget* errorEventTarget();
    1108     virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, PassRefPtr<ScriptCallStack>);
     1108    virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack>);
    11091109
    11101110    void initDNSPrefetch();
  • trunk/Source/WebCore/dom/ScriptExecutionContext.cpp

    r149125 r149131  
    6565    WTF_MAKE_NONCOPYABLE(PendingException);
    6666public:
    67     PendingException(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack> callStack)
     67    PendingException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, PassRefPtr<ScriptCallStack> callStack)
    6868        : m_errorMessage(errorMessage)
    6969        , m_lineNumber(lineNumber)
     70        , m_columnNumber(columnNumber)
    7071        , m_sourceURL(sourceURL)
    7172        , m_callStack(callStack)
     
    7475    String m_errorMessage;
    7576    int m_lineNumber;
     77    int m_columnNumber;
    7678    String m_sourceURL;
    7779    RefPtr<ScriptCallStack> m_callStack;
     
    280282}
    281283
    282 void ScriptExecutionContext::reportException(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack> callStack, CachedScript* cachedScript)
     284void ScriptExecutionContext::reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, PassRefPtr<ScriptCallStack> callStack, CachedScript* cachedScript)
    283285{
    284286    if (m_inDispatchErrorEvent) {
    285287        if (!m_pendingExceptions)
    286288            m_pendingExceptions = adoptPtr(new Vector<OwnPtr<PendingException> >());
    287         m_pendingExceptions->append(adoptPtr(new PendingException(errorMessage, lineNumber, sourceURL, callStack)));
     289        m_pendingExceptions->append(adoptPtr(new PendingException(errorMessage, lineNumber, columnNumber, sourceURL, callStack)));
    288290        return;
    289291    }
     
    291293    // First report the original exception and only then all the nested ones.
    292294    if (!dispatchErrorEvent(errorMessage, lineNumber, sourceURL, cachedScript))
    293         logExceptionToConsole(errorMessage, sourceURL, lineNumber, callStack);
     295        logExceptionToConsole(errorMessage, sourceURL, lineNumber, columnNumber, callStack);
    294296
    295297    if (!m_pendingExceptions)
     
    298300    for (size_t i = 0; i < m_pendingExceptions->size(); i++) {
    299301        PendingException* e = m_pendingExceptions->at(i).get();
    300         logExceptionToConsole(e->m_errorMessage, e->m_sourceURL, e->m_lineNumber, e->m_callStack);
     302        logExceptionToConsole(e->m_errorMessage, e->m_sourceURL, e->m_lineNumber, e->m_columnNumber, e->m_callStack);
    301303    }
    302304    m_pendingExceptions.clear();
  • trunk/Source/WebCore/dom/ScriptExecutionContext.h

    r149125 r149131  
    7878    bool sanitizeScriptError(String& errorMessage, int& lineNumber, String& sourceURL, CachedScript* = 0);
    7979    // FIXME: <http://webkit.org/b/114315> ScriptExecutionContext log exception should include a column number
    80     void reportException(const String& errorMessage, int lineNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>, CachedScript* = 0);
     80    void reportException(const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL, PassRefPtr<ScriptCallStack>, CachedScript* = 0);
    8181
    8282    void addConsoleMessage(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, ScriptState* = 0, unsigned long requestIdentifier = 0);
     
    186186    virtual void addMessage(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, PassRefPtr<ScriptCallStack>, ScriptState* = 0, unsigned long requestIdentifier = 0) = 0;
    187187    virtual EventTarget* errorEventTarget() = 0;
    188     // FIXME: <http://webkit.org/b/114315> ScriptExecutionContext log exception should include a column number
    189     virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, PassRefPtr<ScriptCallStack>) = 0;
     188    virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack>) = 0;
    190189    bool dispatchErrorEvent(const String& errorMessage, int lineNumber, const String& sourceURL, CachedScript*);
    191190
  • trunk/Source/WebCore/workers/DefaultSharedWorkerRepository.cpp

    r149125 r149131  
    177177}
    178178
    179 static void postExceptionTask(ScriptExecutionContext* context, const String& errorMessage, int lineNumber, int /*columnNumber*/, const String& sourceURL)
    180 {
    181     // FIXME: <http://webkit.org/b/114315> ScriptExecutionContext log exception should include a column number
    182     context->reportException(errorMessage, lineNumber, sourceURL, 0);
     179static void postExceptionTask(ScriptExecutionContext* context, const String& errorMessage, int lineNumber, int columnNumber, const String& sourceURL)
     180{
     181    context->reportException(errorMessage, lineNumber, columnNumber, sourceURL, 0);
    183182}
    184183
  • trunk/Source/WebCore/workers/SharedWorkerContext.cpp

    r149125 r149131  
    7979}
    8080
    81 void SharedWorkerContext::logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, PassRefPtr<ScriptCallStack> callStack)
     81void SharedWorkerContext::logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack> callStack)
    8282{
    83     // FIXME: <http://webkit.org/b/114315> ScriptExecutionContext log exception should include a column number
    84     WorkerContext::logExceptionToConsole(errorMessage, sourceURL, lineNumber, callStack);
    85     addMessageToWorkerConsole(JSMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber, 0, callStack);
     83    WorkerContext::logExceptionToConsole(errorMessage, sourceURL, lineNumber, columnNumber, callStack);
     84    addMessageToWorkerConsole(JSMessageSource, ErrorMessageLevel, errorMessage, sourceURL, lineNumber, columnNumber, callStack);
    8685}
    8786
  • trunk/Source/WebCore/workers/SharedWorkerContext.h

    r145930 r149131  
    6161    private:
    6262        SharedWorkerContext(const String& name, const KURL&, const String& userAgent, PassOwnPtr<GroupSettings>, SharedWorkerThread*);
    63         virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, PassRefPtr<ScriptCallStack>) OVERRIDE;
     63        virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack>) OVERRIDE;
    6464
    6565        String m_name;
  • trunk/Source/WebCore/workers/WorkerContext.cpp

    r149125 r149131  
    274274}
    275275
    276 void WorkerContext::logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, PassRefPtr<ScriptCallStack>)
    277 {
    278     // FIXME: <http://webkit.org/b/114315> ScriptExecutionContext log exception should include a column number
    279     thread()->workerReportingProxy().postExceptionToWorkerObject(errorMessage, lineNumber, 0, sourceURL);
     276void WorkerContext::logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack>)
     277{
     278    thread()->workerReportingProxy().postExceptionToWorkerObject(errorMessage, lineNumber, columnNumber, sourceURL);
    280279}
    281280
  • trunk/Source/WebCore/workers/WorkerContext.h

    r149125 r149131  
    145145        void applyContentSecurityPolicyFromString(const String& contentSecurityPolicy, ContentSecurityPolicy::HeaderType);
    146146
    147         virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, PassRefPtr<ScriptCallStack>) OVERRIDE;
     147        virtual void logExceptionToConsole(const String& errorMessage, const String& sourceURL, int lineNumber, int columnNumber, PassRefPtr<ScriptCallStack>) OVERRIDE;
    148148        void addMessageToWorkerConsole(MessageSource, MessageLevel, const String& message, const String& sourceURL, unsigned lineNumber, unsigned columnNumber, PassRefPtr<ScriptCallStack>, ScriptState* = 0, unsigned long requestIdentifier = 0);
    149149
  • trunk/Source/WebCore/workers/WorkerMessagingProxy.cpp

    r149125 r149131  
    139139
    140140        bool errorHandled = !workerObject->dispatchEvent(ErrorEvent::create(m_errorMessage, m_sourceURL, m_lineNumber));
    141         if (!errorHandled) {
    142             // FIXME: <http://webkit.org/b/114315> ScriptExecutionContext log exception should include a column number
    143             context->reportException(m_errorMessage, m_lineNumber, m_sourceURL, 0);
    144         }
     141        if (!errorHandled)
     142            context->reportException(m_errorMessage, m_lineNumber, m_columnNumber, m_sourceURL, 0);
    145143    }
    146144
Note: See TracChangeset for help on using the changeset viewer.