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
3// found in the LICENSE file.
4
5var o = {
6  f: function() { throw new Error(); },
7  get j() { o.h(); },
8  set k(_) { o.j; },
9};
10o.g1 = function() { o.f() }
11o.g2 = o.g1;
12o.h = function() { o.g1() }
13
14try {
15  o.k = 42;
16} catch (e) {
17  Error.prepareStackTrace = function(e, frames) { return frames; };
18  var frames = e.stack;
19  Error.prepareStackTrace = undefined;
20  assertEquals("f", frames[0].getMethodName());
21  assertEquals(null, frames[1].getMethodName());
22  assertEquals("h", frames[2].getMethodName());
23  assertEquals("j", frames[3].getMethodName());
24  assertEquals("k", frames[4].getMethodName());
25  assertEquals(null, frames[5].getMethodName());
26}
27