Index: test/mjsunit/mjsunit.js |
diff --git a/test/mjsunit/mjsunit.js b/test/mjsunit/mjsunit.js |
index bc3afe502fc6d256d733d13eefb9589e9a9cd4f0..328195f22409f38320d74d302109de46f0704afe 100644 |
--- a/test/mjsunit/mjsunit.js |
+++ b/test/mjsunit/mjsunit.js |
@@ -149,6 +149,9 @@ var isCrankshafted; |
// Returns true if given function is compiled by TurboFan. |
var isTurboFanned; |
+// Monkey-patchable all-purpose failure handler. |
+var failWithMessage; |
+ |
(function () { // Scope for utility functions. |
@@ -233,7 +236,8 @@ var isTurboFanned; |
} |
- function failWithMessage(message) { |
+ failWithMessage = function failWithMessage(message) { |
+ print("oh, we failed: " + message); |
throw new MjsUnitAssertionError(message); |
} |
@@ -251,7 +255,7 @@ var isTurboFanned; |
} else { |
message += ":\nexpected:\n" + expectedText + "\nfound:\n" + foundText; |
} |
- throw new MjsUnitAssertionError(message); |
+ return failWithMessage(message); |
} |