Changeset 54138 in webkit


Ignore:
Timestamp:
Feb 1, 2010 10:35:32 AM (14 years ago)
Author:
benm@google.com
Message:

ScriptCallFrame's do not get line numbers/source id's if the caller is unkown.
https://bugs.webkit.org/show_bug.cgi?id=34335

Reviewed by Darin Adler.

WebCore:

  • bindings/js/ScriptCallStack.cpp:

(WebCore::ScriptCallStack::ScriptCallStack): If the caller is unknown, the line number and source information is still availble so pass it to the ScriptCallFrame being constructed.

LayoutTests:

Update layout tests that did not have source and line number information for their console messages, as this information is now available to the ScriptCallFrame and thus can be passed to the inspector, for example.

  • fast/js/console-non-string-values-expected.txt: Add console line number/source.
  • userscripts/script-not-run-for-fragments-expected.txt: ditto.
  • userscripts/script-run-at-start-expected.txt: ditto.
  • platform/gtk/inspector/console-log-before-inspector-open-expected.txt: Removed as platform workarounds no longer necessary.
  • platform/mac/inspector/console-log-before-inspector-open-expected.txt: ditto.
  • platform/win/inspector/console-log-before-inspector-open-expected.txt: ditto.
Location:
trunk
Files:
3 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r54135 r54138  
     12010-02-01  Ben Murdoch  <benm@google.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        ScriptCallFrame's do not get line numbers/source id's if the caller is unkown.
     6        https://bugs.webkit.org/show_bug.cgi?id=34335
     7
     8        Update layout tests that did not have source and line number information for their console messages, as this information is now available to the ScriptCallFrame and thus can be passed to the inspector, for example.
     9
     10        * fast/js/console-non-string-values-expected.txt: Add console line number/source.
     11        * userscripts/script-not-run-for-fragments-expected.txt: ditto.
     12        * userscripts/script-run-at-start-expected.txt: ditto.
     13        * platform/gtk/inspector/console-log-before-inspector-open-expected.txt: Removed as platform workarounds no longer necessary.
     14        * platform/mac/inspector/console-log-before-inspector-open-expected.txt: ditto.
     15        * platform/win/inspector/console-log-before-inspector-open-expected.txt: ditto.
     16 
     17
    1182010-02-01  Csaba Osztrogonác  <ossy@webkit.org>
    219
  • trunk/LayoutTests/fast/js/console-non-string-values-expected.txt

    r41640 r54138  
    1 CONSOLE MESSAGE: line 0: I am a string
    2 CONSOLE MESSAGE: line 0: 42
     1CONSOLE MESSAGE: line 12: I am a string
     2CONSOLE MESSAGE: line 13: 42
    33Should see two console messages, the first a string, and the second a number.
    44PASS successfullyParsed is true
  • trunk/LayoutTests/userscripts/script-not-run-for-fragments-expected.txt

    r53917 r54138  
    1 CONSOLE MESSAGE: line 0: injected
    2 CONSOLE MESSAGE: line 0: injected
     1CONSOLE MESSAGE: line 1: injected
     2CONSOLE MESSAGE: line 1: injected
    33This test should not infinitely inject user scripts.
  • trunk/LayoutTests/userscripts/script-run-at-start-expected.txt

    r53917 r54138  
    1 CONSOLE MESSAGE: line 0: SUCCESS
    2 CONSOLE MESSAGE: line 0: SUCCESS
     1CONSOLE MESSAGE: line 1: SUCCESS
     2CONSOLE MESSAGE: line 1: SUCCESS
    33This test should log a console message on success.
  • trunk/WebCore/ChangeLog

    r54137 r54138  
     12010-02-01  Ben Murdoch  <benm@google.com>
     2
     3        Reviewed by Darin Adler.
     4
     5        ScriptCallFrame's do not get line numbers/source id's if the caller is unkown.
     6        https://bugs.webkit.org/show_bug.cgi?id=34335
     7
     8        * bindings/js/ScriptCallStack.cpp:
     9        (WebCore::ScriptCallStack::ScriptCallStack): If the caller is unknown, the line number and source information is still availble so pass it to the ScriptCallFrame being constructed.
     10
    1112010-02-01  Dirk Schulze  <krit@webkit.org>
    212
  • trunk/WebCore/bindings/js/ScriptCallStack.cpp

    r51801 r54138  
    5555    exec->interpreter()->retrieveLastCaller(exec, signedLineNumber, sourceID, urlString, function);
    5656
     57    unsigned lineNumber = signedLineNumber >= 0 ? signedLineNumber : 0;
     58
    5759    if (function) {
    5860        m_caller = asInternalFunction(function);
    59         unsigned lineNumber = signedLineNumber >= 0 ? signedLineNumber : 0;
    6061        m_frames.append(ScriptCallFrame(m_caller->name(m_exec), urlString, lineNumber, args, skipArgumentCount));
    6162    } else {
    6263        // Caller is unknown, but we should still add the frame, because
    6364        // something called us, and gave us arguments.
    64         m_frames.append(ScriptCallFrame(UString(), UString(), 0, args, skipArgumentCount));
     65        m_frames.append(ScriptCallFrame(UString(), urlString, lineNumber, args, skipArgumentCount));
    6566    }
    6667}
Note: See TracChangeset for help on using the changeset viewer.