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

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

Issue 1751403004: Handle ES2015 Function.name in CallSite::GetMethodName (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/messages.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
index fbf650ddbfd35f874ab447927cb64e0d9ca8bba3..75fad636e0d601fe0dca273e86579b01322760ef 100644
--- a/test/mjsunit/stack-traces-custom.js
+++ b/test/mjsunit/stack-traces-custom.js
@@ -2,19 +2,25 @@
// 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(); } };
+var o = {
+ f: function() { throw new Error(); },
+ get j() { o.h(); },
+ set k(_) { o.j; },
+};
o.g1 = function() { o.f() }
o.g2 = o.g1;
o.h = function() { o.g1() }
-Error.prepareStackTrace = function(e, frames) { return frames; }
-
try {
- o.h();
+ o.k = 42;
} catch (e) {
+ Error.prepareStackTrace = function(e, frames) { return frames; };
var frames = e.stack;
+ Error.prepareStackTrace = undefined;
assertEquals("f", frames[0].getMethodName());
assertEquals(null, frames[1].getMethodName());
assertEquals("h", frames[2].getMethodName());
- assertEquals(null, frames[3].getMethodName());
+ assertEquals("j", frames[3].getMethodName());
+ assertEquals("k", frames[4].getMethodName());
+ assertEquals(null, frames[5].getMethodName());
}
« no previous file with comments | « src/messages.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698