[Webkit-unassigned] [Bug 70605] New: First stack frame when evaluating a script is missing
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Fri Oct 21 07:16:14 PDT 2011
https://bugs.webkit.org/show_bug.cgi?id=70605
Summary: First stack frame when evaluating a script is missing
Product: WebKit
Version: 528+ (Nightly build)
Platform: All
URL: http://poshnet.ch/stack_test.html
OS/Version: All
Status: UNCONFIRMED
Severity: Normal
Priority: P2
Component: WebCore JavaScript
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: michschn at google.com
To reproduce
1) Open Safari on http://poshnet.ch/stack_test.html. It contains the script
function foo() {
console.trace();
}
console.trace();
foo();
2) Open the console
observe: the output is
console.trace()
(anonymous function)
console.trace()
foo
Note that the second trace is missing the bottom frame, the anonymous evaluate script. This is very confusing as it looks as if the browser invoked foo directly. Chrome shows the (anonymous function) stack frame in both cases.
This seems to be due to ScriptCallStackFactory.cpp:73
if (function)
functionName = asFunction(function)->name(exec);
else {
// Caller is unknown, but if frames is empty we should still add the frame, because
// something called us, and gave us arguments.
if (!frames.isEmpty())
break;
}
where anonymous frames (such as the script eval) are dropped if other stack frames are on top of it. What is the exact purpose of that "if"? If we can change that, ie. drop the else, I'm more than happy to provide a patch.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list