Commit f18574d2 authored by benm@google.com's avatar benm@google.com

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.



git-svn-id: svn://svn.chromium.org/blink/trunk@54138 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent b8995212
2010-02-01 Ben Murdoch <benm@google.com>
Reviewed by Darin Adler.
ScriptCallFrame's do not get line numbers/source id's if the caller is unkown.
https://bugs.webkit.org/show_bug.cgi?id=34335
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.
2010-02-01 Csaba Osztrogonác <ossy@webkit.org> 2010-02-01 Csaba Osztrogonác <ossy@webkit.org>
Rubber-stamped by Kenneth Rohde Christiansen. Rubber-stamped by Kenneth Rohde Christiansen.
......
CONSOLE MESSAGE: line 0: I am a string CONSOLE MESSAGE: line 12: I am a string
CONSOLE MESSAGE: line 0: 42 CONSOLE MESSAGE: line 13: 42
Should see two console messages, the first a string, and the second a number. Should see two console messages, the first a string, and the second a number.
PASS successfullyParsed is true PASS successfullyParsed is true
......
CONSOLE MESSAGE: line 0: log
CONSOLE MESSAGE: line 0: debug
CONSOLE MESSAGE: line 0: info
CONSOLE MESSAGE: line 0: warn
CONSOLE MESSAGE: line 0: error
Tests that Web Inspector won't crash if some console have been logged by the time it's opening.
log
debug
info
warn
error
CONSOLE MESSAGE: line 0: log
CONSOLE MESSAGE: line 0: debug
CONSOLE MESSAGE: line 0: info
CONSOLE MESSAGE: line 0: warn
CONSOLE MESSAGE: line 0: error
Tests that Web Inspector won't crash if some console have been logged by the time it's opening.
log
debug
info
warn
error
CONSOLE MESSAGE: line 0: log
CONSOLE MESSAGE: line 0: debug
CONSOLE MESSAGE: line 0: info
CONSOLE MESSAGE: line 0: warn
CONSOLE MESSAGE: line 0: error
Tests that Web Inspector won't crash if some console have been logged by the time it's opening.
log
debug
info
warn
error
CONSOLE MESSAGE: line 0: injected CONSOLE MESSAGE: line 1: injected
CONSOLE MESSAGE: line 0: injected CONSOLE MESSAGE: line 1: injected
This test should not infinitely inject user scripts. This test should not infinitely inject user scripts.
CONSOLE MESSAGE: line 0: SUCCESS CONSOLE MESSAGE: line 1: SUCCESS
CONSOLE MESSAGE: line 0: SUCCESS CONSOLE MESSAGE: line 1: SUCCESS
This test should log a console message on success. This test should log a console message on success.
2010-02-01 Ben Murdoch <benm@google.com>
Reviewed by Darin Adler.
ScriptCallFrame's do not get line numbers/source id's if the caller is unkown.
https://bugs.webkit.org/show_bug.cgi?id=34335
* 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.
2010-02-01 Dirk Schulze <krit@webkit.org> 2010-02-01 Dirk Schulze <krit@webkit.org>
Reviewed by Simon Fraser. Reviewed by Simon Fraser.
......
...@@ -54,14 +54,15 @@ ScriptCallStack::ScriptCallStack(ExecState* exec, const ArgList& args, unsigned ...@@ -54,14 +54,15 @@ ScriptCallStack::ScriptCallStack(ExecState* exec, const ArgList& args, unsigned
exec->interpreter()->retrieveLastCaller(exec, signedLineNumber, sourceID, urlString, function); exec->interpreter()->retrieveLastCaller(exec, signedLineNumber, sourceID, urlString, function);
unsigned lineNumber = signedLineNumber >= 0 ? signedLineNumber : 0;
if (function) { if (function) {
m_caller = asInternalFunction(function); m_caller = asInternalFunction(function);
unsigned lineNumber = signedLineNumber >= 0 ? signedLineNumber : 0;
m_frames.append(ScriptCallFrame(m_caller->name(m_exec), urlString, lineNumber, args, skipArgumentCount)); m_frames.append(ScriptCallFrame(m_caller->name(m_exec), urlString, lineNumber, args, skipArgumentCount));
} else { } else {
// Caller is unknown, but we should still add the frame, because // Caller is unknown, but we should still add the frame, because
// something called us, and gave us arguments. // something called us, and gave us arguments.
m_frames.append(ScriptCallFrame(UString(), UString(), 0, args, skipArgumentCount)); m_frames.append(ScriptCallFrame(UString(), urlString, lineNumber, args, skipArgumentCount));
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment