v8/test/mjsunit/stack-traces-display-name.js
verwaest 953874e974 Use displayName in Error.stack rendering if present.
BUG=v8:4761
LOG=y

Review URL: https://codereview.chromium.org/1706823003

Cr-Commit-Position: refs/heads/master@{#34105}
2016-02-18 09:43:06 +00:00

16 lines
416 B
JavaScript

// Copyright 2016 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() }
o.f.displayName = "MySpecialFunction";
try {
o.h();
} catch (e) {
assertTrue(e.stack.indexOf("MySpecialFunction") != -1);
}