Changeset 138003 in webkit


Ignore:
Timestamp:
Dec 18, 2012 2:47:41 AM (11 years ago)
Author:
yurys@chromium.org
Message:

Web Inspector: MediaQueryList listener silently catches errors
https://bugs.webkit.org/show_bug.cgi?id=105162

Reviewed by Alexander Pavlov.

Source/WebCore:

Drive-by: removed unused ScriptCallback::call(bool).

Test: inspector-protocol/media-query-listener-exception.html

  • bindings/js/ScriptFunctionCall.cpp:

(WebCore::ScriptCallback::call):

  • bindings/js/ScriptFunctionCall.h:

(ScriptCallback):

  • bindings/v8/ScriptFunctionCall.cpp: report uncaught exception to the inspector

if it was thrown during the function call.
(WebCore::ScriptCallback::call):

  • bindings/v8/ScriptFunctionCall.h:

(ScriptCallback):

LayoutTests:

Test that uncaught exception in MediaQueryListListener will be logged to the console.

  • http/tests/inspector-protocol/resources/protocol-test.js:

(runTest):

  • inspector-protocol/media-query-listener-exception-expected.txt: Added.
  • inspector-protocol/media-query-listener-exception.html: Added.
Location:
trunk
Files:
2 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r138002 r138003  
     12012-12-17  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Web Inspector: MediaQueryList listener silently catches errors
     4        https://bugs.webkit.org/show_bug.cgi?id=105162
     5
     6        Reviewed by Alexander Pavlov.
     7
     8        Test that uncaught exception in MediaQueryListListener will be logged to the console.
     9
     10        * http/tests/inspector-protocol/resources/protocol-test.js:
     11        (runTest):
     12        * inspector-protocol/media-query-listener-exception-expected.txt: Added.
     13        * inspector-protocol/media-query-listener-exception.html: Added.
     14
    1152012-12-18  Dominik Röttsches  <dominik.rottsches@intel.com>
    216
  • trunk/LayoutTests/http/tests/inspector-protocol/resources/protocol-test.js

    r129595 r138003  
    6464function runTest()
    6565{
     66    if (!window.testRunner) {
     67        console.error("This test requires DumpRenderTree");
     68        return;
     69    }
    6670    testRunner.dumpAsText();
    6771    testRunner.waitUntilDone();
  • trunk/Source/WebCore/ChangeLog

    r138000 r138003  
     12012-12-17  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Web Inspector: MediaQueryList listener silently catches errors
     4        https://bugs.webkit.org/show_bug.cgi?id=105162
     5
     6        Reviewed by Alexander Pavlov.
     7
     8        Drive-by: removed unused ScriptCallback::call(bool).
     9
     10        Test: inspector-protocol/media-query-listener-exception.html
     11
     12        * bindings/js/ScriptFunctionCall.cpp:
     13        (WebCore::ScriptCallback::call):
     14        * bindings/js/ScriptFunctionCall.h:
     15        (ScriptCallback):
     16        * bindings/v8/ScriptFunctionCall.cpp: report uncaught exception to the inspector
     17        if it was thrown during the function call.
     18        (WebCore::ScriptCallback::call):
     19        * bindings/v8/ScriptFunctionCall.h:
     20        (ScriptCallback):
     21
    1222012-12-18  Eugene Klyuchnikov  <eustas@chromium.org>
    223
  • trunk/Source/WebCore/bindings/js/ScriptFunctionCall.cpp

    r129476 r138003  
    199199ScriptValue ScriptCallback::call()
    200200{
    201     bool hadException;
    202     return call(hadException);
    203 }
    204 
    205 ScriptValue ScriptCallback::call(bool& hadException)
    206 {
    207201    JSLockHolder lock(m_exec);
    208202
     
    213207
    214208    JSValue result = JSC::call(m_exec, m_function.jsValue(), callType, callData, m_function.jsValue(), m_arguments);
    215     hadException = m_exec->hadException();
     209    bool hadException = m_exec->hadException();
    216210
    217211    if (hadException) {
  • trunk/Source/WebCore/bindings/js/ScriptFunctionCall.h

    r127191 r138003  
    8989
    9090        ScriptValue call();
    91         ScriptValue call(bool& hadException);
    9291
    9392    private:
  • trunk/Source/WebCore/bindings/v8/ScriptFunctionCall.cpp

    r136822 r138003  
    186186ScriptValue ScriptCallback::call()
    187187{
    188     bool hadException = false;
    189     return call(hadException);
    190 }
    191 
    192 ScriptValue ScriptCallback::call(bool& hadException)
    193 {
    194188    ASSERT(v8::Context::InContext());
    195189    ASSERT(m_function.v8Value()->IsFunction());
    196190
    197191    v8::TryCatch exceptionCatcher;
     192    exceptionCatcher.SetVerbose(true);
    198193    v8::Handle<v8::Object> object = v8::Context::GetCurrent()->Global();
    199194    v8::Handle<v8::Function> function = v8::Handle<v8::Function>::Cast(m_function.v8Value());
     
    204199
    205200    v8::Handle<v8::Value> result = ScriptController::callFunctionWithInstrumentation(0, function, object, m_arguments.size(), args.get());
    206 
    207     if (exceptionCatcher.HasCaught()) {
    208         hadException = true;
    209         m_scriptState->setException(exceptionCatcher.Exception());
    210         return ScriptValue();
    211     }
    212 
    213201    return ScriptValue(result);
    214202}
  • trunk/Source/WebCore/bindings/v8/ScriptFunctionCall.h

    r127757 r138003  
    7878
    7979        ScriptValue call();
    80         ScriptValue call(bool& hadException);
    8180
    8281    private:
Note: See TracChangeset for help on using the changeset viewer.