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

Unified Diff: test/mjsunit/stack-traces-custom.js

Issue 1122973002: Move more parts of stack trace formatting to runtime. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: addressed comments Created 5 years, 7 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-custom.js
diff --git a/test/mjsunit/stack-traces-custom.js b/test/mjsunit/stack-traces-custom.js
new file mode 100644
index 0000000000000000000000000000000000000000..fbf650ddbfd35f874ab447927cb64e0d9ca8bba3
--- /dev/null
+++ b/test/mjsunit/stack-traces-custom.js
@@ -0,0 +1,20 @@
+// Copyright 2015 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() }
+
+Error.prepareStackTrace = function(e, frames) { return frames; }
+
+try {
+ o.h();
+} catch (e) {
+ var frames = e.stack;
+ assertEquals("f", frames[0].getMethodName());
+ assertEquals(null, frames[1].getMethodName());
+ assertEquals("h", frames[2].getMethodName());
+ assertEquals(null, frames[3].getMethodName());
+}
« 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