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

Unified Diff: test/mjsunit/stack-traces-display-name.js

Issue 1706823003: Use displayName in Error.stack rendering if present. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 10 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/runtime/runtime-internal.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/stack-traces-display-name.js
diff --git a/test/mjsunit/stack-traces-display-name.js b/test/mjsunit/stack-traces-display-name.js
new file mode 100644
index 0000000000000000000000000000000000000000..0b7c0fceb083c8524776bf7cafa1a93c8343a7fe
--- /dev/null
+++ b/test/mjsunit/stack-traces-display-name.js
@@ -0,0 +1,15 @@
+// Copyright 2016 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+var o = { f: function() { throw new Error(); } };
+o.g1 = function() { o.f() }
+o.g2 = o.g1;
+o.h = function() { o.g1() }
+o.f.displayName = "MySpecialFunction";
+
+try {
+ o.h();
+} catch (e) {
+ assertTrue(e.stack.indexOf("MySpecialFunction") != -1);
+}
« no previous file with comments | « src/runtime/runtime-internal.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698