blob: 75fad636e0d601fe0dca273e86579b01322760ef [file] [log] [blame]
Ben Murdoch4a90d5f2016-03-22 12:00:34 +00001// 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
3// found in the LICENSE file.
4
Ben Murdochda12d292016-06-02 14:46:10 +01005var o = {
6 f: function() { throw new Error(); },
7 get j() { o.h(); },
8 set k(_) { o.j; },
9};
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000010o.g1 = function() { o.f() }
11o.g2 = o.g1;
12o.h = function() { o.g1() }
13
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000014try {
Ben Murdochda12d292016-06-02 14:46:10 +010015 o.k = 42;
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000016} catch (e) {
Ben Murdochda12d292016-06-02 14:46:10 +010017 Error.prepareStackTrace = function(e, frames) { return frames; };
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000018 var frames = e.stack;
Ben Murdochda12d292016-06-02 14:46:10 +010019 Error.prepareStackTrace = undefined;
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000020 assertEquals("f", frames[0].getMethodName());
21 assertEquals(null, frames[1].getMethodName());
22 assertEquals("h", frames[2].getMethodName());
Ben Murdochda12d292016-06-02 14:46:10 +010023 assertEquals("j", frames[3].getMethodName());
24 assertEquals("k", frames[4].getMethodName());
25 assertEquals(null, frames[5].getMethodName());
Ben Murdoch4a90d5f2016-03-22 12:00:34 +000026}