Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Unified Diff: src/frames.cc

Issue 555170: Show user script source line that caused exception intead of a line in a nati... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 10 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/frames.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/frames.cc
===================================================================
--- src/frames.cc (revision 3748)
+++ src/frames.cc (working copy)
@@ -176,7 +176,7 @@
StackTraceFrameIterator::StackTraceFrameIterator() {
- if (!done() && !frame()->function()->IsJSFunction()) Advance();
+ if (!done() && !IsValidFrame()) Advance();
}
@@ -184,11 +184,19 @@
while (true) {
JavaScriptFrameIterator::Advance();
if (done()) return;
- if (frame()->function()->IsJSFunction()) return;
+ if (IsValidFrame()) return;
}
}
+bool StackTraceFrameIterator::IsValidFrame() {
+ if (!frame()->function()->IsJSFunction()) return false;
+ Object* script = JSFunction::cast(frame()->function())->shared()->script();
+ // Don't show functions from native scripts to user.
+ return (script->IsScript() &&
+ Script::TYPE_NATIVE != Script::cast(script)->type()->value());
+}
+
// -------------------------------------------------------------------------
« no previous file with comments | « src/frames.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698