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

Unified Diff: src/messages.js

Issue 151145: Experimental: capture 10 frame stack trace by default. (Closed)
Patch Set: Created 11 years, 6 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/flag-definitions.h ('k') | src/runtime.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/messages.js
diff --git a/src/messages.js b/src/messages.js
index 882fed5e2e7883316da5133f20de6f8380cf10e3..efa2fd130f7227fc6b7b9c7dbd35321af74aa15a 100644
--- a/src/messages.js
+++ b/src/messages.js
@@ -812,8 +812,12 @@ function DefineError(f) {
} else if (!IS_UNDEFINED(m)) {
this.message = ToString(m);
}
- if ($Error.captureStackTraces) {
- var raw_stack = %CollectStackTrace(f);
+ var stackTraceLimit = $Error.stackTraceLimit;
+ if (stackTraceLimit) {
+ // Cap the limit to avoid extremely big traces
+ if (stackTraceLimit < 0 || stackTraceLimit > 10000)
+ stackTraceLimit = 10000;
+ var raw_stack = %CollectStackTrace(f, stackTraceLimit);
DefineOneShotAccessor(this, 'stack', function (obj) {
return FormatRawStackTrace(obj, raw_stack);
});
« no previous file with comments | « src/flag-definitions.h ('k') | src/runtime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698