Revert of mjsunit: Fix the error message produced by assertInstanceof. (patchset #1 id:1 of https://codereview.chromium.org/2413153004/ )
Reason for revert: This is probably not working for falsey values. I cannot JavaScript :P Original issue's description: > mjsunit: Fix the error message produced by assertInstanceof. > > Used to be: > > Failure: expected <foo> is not an instance of <Bar> but of < Baz>> found <undefined> > > Should be: > > Failure: <foo> is not an instance of <Bar> but of <Baz> > > BUG= > > Committed: https://crrev.com/2a480eff395756f36eb0ae2fc0a573454b394268 > Cr-Commit-Position: refs/heads/master@{#40319} TBR=verwaest@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG= Review-Url: https://codereview.chromium.org/2421033003 Cr-Commit-Position: refs/heads/master@{#40331}
This commit is contained in:
parent
bca9690372
commit
7d1a7df120
@ -206,16 +206,13 @@ var assertMatches;
|
||||
|
||||
function fail(expectedText, found, name_opt) {
|
||||
var message = "Fail" + "ure";
|
||||
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;
|
||||
if (name_opt) {
|
||||
// Fix this when we ditch the old test runner.
|
||||
message += " (" + name_opt + ")";
|
||||
}
|
||||
|
||||
message += ": expected <" + expectedText +
|
||||
"> found <" + PrettyPrint(found) + ">";
|
||||
throw new MjsUnitAssertionError(message);
|
||||
}
|
||||
|
||||
@ -399,7 +396,7 @@ var assertMatches;
|
||||
}
|
||||
fail("Object <" + PrettyPrint(obj) + "> is not an instance of <" +
|
||||
(type.name || type) + ">" +
|
||||
(actualTypeName ? " but of <" + actualTypeName + ">" : ""));
|
||||
(actualTypeName ? " but of < " + actualTypeName + ">" : ""));
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user