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

Side by Side 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, 9 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 unified diff | Download patch
« no previous file with comments | « src/messages.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var o = { f: function() { throw new Error(); } }; 5 var o = {
6 f: function() { throw new Error(); },
7 get j() { o.h(); },
8 set k(_) { o.j; },
9 };
6 o.g1 = function() { o.f() } 10 o.g1 = function() { o.f() }
7 o.g2 = o.g1; 11 o.g2 = o.g1;
8 o.h = function() { o.g1() } 12 o.h = function() { o.g1() }
9 13
10 Error.prepareStackTrace = function(e, frames) { return frames; }
11
12 try { 14 try {
13 o.h(); 15 o.k = 42;
14 } catch (e) { 16 } catch (e) {
17 Error.prepareStackTrace = function(e, frames) { return frames; };
15 var frames = e.stack; 18 var frames = e.stack;
19 Error.prepareStackTrace = undefined;
16 assertEquals("f", frames[0].getMethodName()); 20 assertEquals("f", frames[0].getMethodName());
17 assertEquals(null, frames[1].getMethodName()); 21 assertEquals(null, frames[1].getMethodName());
18 assertEquals("h", frames[2].getMethodName()); 22 assertEquals("h", frames[2].getMethodName());
19 assertEquals(null, frames[3].getMethodName()); 23 assertEquals("j", frames[3].getMethodName());
24 assertEquals("k", frames[4].getMethodName());
25 assertEquals(null, frames[5].getMethodName());
20 } 26 }
OLDNEW
« 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