Index: test/mjsunit/stack-traces.js |
diff --git a/test/mjsunit/stack-traces.js b/test/mjsunit/stack-traces.js |
index f80a627b24a87eae9fe00e5bd0a24c5b7f5af903..ac4f2f127d574d6e678c0e839ac11b8baf824326 100644 |
--- a/test/mjsunit/stack-traces.js |
+++ b/test/mjsunit/stack-traces.js |
@@ -94,6 +94,19 @@ function testAnonymousMethod() { |
(function () { FAIL }).call([1, 2, 3]); |
} |
+function testMethodDisplayName() { |
+ function gen(name, counter) { |
+ var f = function() { |
+ if (counter === 0) |
+ FAIL; |
aandrey
2015/02/11 15:50:40
nit: use { } in v8 code
kozy
2015/02/11 16:11:56
Done.
|
+ gen(name, counter - 1)(); |
+ }; |
+ f.displayName = name + '_' + counter; |
+ return f; |
+ }; |
+ gen('foo', 2)(); |
+} |
+ |
function CustomError(message, stripPoint) { |
this.message = message; |
Error.captureStackTrace(this, stripPoint); |
@@ -261,6 +274,8 @@ testTrace("testValue", testValue, ["at Number.causeError"]); |
testTrace("testConstructor", testConstructor, ["new Plonk"]); |
testTrace("testRenamedMethod", testRenamedMethod, ["Wookie.a$b$c$d [as d]"]); |
testTrace("testAnonymousMethod", testAnonymousMethod, ["Array.<anonymous>"]); |
+testTrace("testMethodDisplayName", testMethodDisplayName, |
+ [" at foo_0", " at foo_1", " at foo_2 "]); |
testTrace("testDefaultCustomError", testDefaultCustomError, |
["hep-hey", "new CustomError"], |
["collectStackTrace"]); |