Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: test/mjsunit/mjsunit.js

Issue 2413153004: mjsunit: Fix the error message produced by assertInstanceof. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/mjsunit.js
diff --git a/test/mjsunit/mjsunit.js b/test/mjsunit/mjsunit.js
index 86052ee0a108fb377ad97f4cde220d26afe82bb2..d56a22701af1af56d119382c23ab6b734b9b4f02 100644
--- a/test/mjsunit/mjsunit.js
+++ b/test/mjsunit/mjsunit.js
@@ -206,13 +206,16 @@ var assertMatches;
function fail(expectedText, found, name_opt) {
var message = "Fail" + "ure";
- if (name_opt) {
- // Fix this when we ditch the old test runner.
- message += " (" + name_opt + ")";
+ if (found) {
+ message += ": expected <" + expectedText +
+ "> found <" + PrettyPrint(found) + ">";
+ if (name_opt) {
+ // Fix this when we ditch the old test runner.
+ message += " (" + name_opt + ")";
+ }
+ } else {
+ message += ": " + expectedText;
}
-
- message += ": expected <" + expectedText +
- "> found <" + PrettyPrint(found) + ">";
throw new MjsUnitAssertionError(message);
}
@@ -396,7 +399,7 @@ var assertMatches;
}
fail("Object <" + PrettyPrint(obj) + "> is not an instance of <" +
(type.name || type) + ">" +
- (actualTypeName ? " but of < " + actualTypeName + ">" : ""));
+ (actualTypeName ? " but of <" + actualTypeName + ">" : ""));
}
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698