Index: test/mjsunit/stack-traces.js |
diff --git a/test/mjsunit/stack-traces.js b/test/mjsunit/stack-traces.js |
index 71d64191c106f979fdf715ba35c36a5c34417d62..b5d58fa0759f3086bce84d139824114d0b80d505 100644 |
--- a/test/mjsunit/stack-traces.js |
+++ b/test/mjsunit/stack-traces.js |
@@ -310,9 +310,9 @@ assertTrue(fired); |
error.stack; |
assertTrue(fired); |
-//Check that throwing exception in a custom stack trace formatting function |
-//does not lead to recursion. |
-Error.prepareStackTrace = function() { throw new Error("abc"); } |
+// Check that throwing exception in a custom stack trace formatting function |
+// does not lead to recursion. |
+Error.prepareStackTrace = function() { throw new Error("abc"); }; |
var message; |
try { |
throw new Error(); |
@@ -321,3 +321,9 @@ try { |
} |
assertEquals("abc", message); |
+ |
+// Test that modifying Error.prepareStackTrace by itself works. |
+Error.prepareStackTrace = function() { Error.prepareStackTrace = "custom"; }; |
+new Error(); |
+ |
+assertEquals("custom", Error.prepareStackTrace); |