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

Unified Diff: src/messages.js

Issue 6259010: Change recursive error printing to just replace recursively (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 9 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 | « no previous file | test/mjsunit/cyclic-error-to-string.js » ('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 d65425525dd0c16e3f3ebf4352a14ff4dfd4e7ea..4a89647577b05b205b62ebc30f65d365d271f1c2 100644
--- a/src/messages.js
+++ b/src/messages.js
@@ -1033,19 +1033,16 @@ function errorToStringDetectCycle() {
}
function errorToString() {
- // These helper functions are needed because access to properties on
+ // This helper function is needed because access to properties on
// the builtins object do not work inside of a catch clause.
function isCyclicErrorMarker(o) { return o === cyclic_error_marker; }
- function isVisitedErrorsEmpty() { return visited_errors.length === 0; }
try {
return %_CallFunction(this, errorToStringDetectCycle);
} catch(e) {
- // Propagate cyclic_error_marker exception until all error
- // formatting is finished and then return the empty string. Safari
- // and Firefox also returns the empty string when converting a
- // cyclic error to a string.
- if (isCyclicErrorMarker(e) && isVisitedErrorsEmpty()) return '';
+ // If this error message was encountered already return the empty
+ // string for it instead of recursively formatting it.
+ if (isCyclicErrorMarker(e)) return '';
else throw e;
}
}
« no previous file with comments | « no previous file | test/mjsunit/cyclic-error-to-string.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698