Fix autoimplementation warnings for recent commits
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Tue, 20 Sep 2011 12:49:36 -0600
changeset 600 fc1acceae8d7
parent 599 7de568f768c6
child 601 8d721ff655d2
Fix autoimplementation warnings for recent commits

Various recent changes to how indeterm/state/value work for various
commands meant it was flagging lots of spec results as bad when they
were actually fine.
tests.js
--- a/tests.js	Mon Sep 19 14:57:47 2011 -0600
+++ b/tests.js	Tue Sep 20 12:49:36 2011 -0600
@@ -3902,8 +3902,8 @@
 			beforeDiv.lastChild.className = "bad-result";
 		}
 	} else {
-		// It always has to be an exception.
-		beforeDiv.lastChild.className = beforeIndeterm === "Exception"
+		// It always has to be false.
+		beforeDiv.lastChild.className = beforeIndeterm === false
 			? "good-result"
 			: "bad-result";
 	}
@@ -3918,8 +3918,7 @@
 		}
 	} else {
 		afterDiv.lastChild.className =
-			("indeterm" in commands[command] && afterIndeterm === false)
-			|| (!("indeterm" in commands[command]) && afterIndeterm === "Exception")
+			afterIndeterm === false
 				? "good-result"
 				: "bad-result";
 	}
@@ -3964,12 +3963,12 @@
 			afterDiv.lastChild.className = "bad-result";
 		}
 	} else {
-		// The general rule is it must either throw an exception or flip the
-		// state.
+		// The general rule is it must flip the state, unless there's no state
+		// defined, in which case it should always be false.
 		beforeDiv.lastChild.className =
 		afterDiv.lastChild.className =
 			("state" in commands[command] && typeof beforeState == "boolean" && typeof afterState == "boolean" && beforeState === !afterState)
-			|| (!("state" in commands[command]) && beforeState === "Exception" && afterState === "Exception")
+			|| (!("state" in commands[command]) && beforeState === false && afterState === false)
 				? "good-result"
 				: "bad-result";
 	}
@@ -3993,12 +3992,9 @@
 		value = legacySizeToCss(getLegacyFontSize(value));
 	} else if (command == "formatblock") {
 		value = value.replace(/^<(.*)>$/, "$1").toLowerCase();
-	} else if (command == "unlink") {
-		value = null;
 	}
 
 	if (((command == "backcolor" || command == "forecolor" || command == "hilitecolor") && value.toLowerCase() == "currentcolor")
-	|| (command == "createlink" && value === "")
 	|| (command == "fontsize" && value === undefined)
 	|| (command == "formatblock" && formattableBlockNames.indexOf(value.replace(/^<(.*)>$/, "$1").trim()) == -1)) {
 		afterDiv.lastChild.className = beforeValue === afterValue
@@ -4017,11 +4013,11 @@
 			? "good-result"
 			: "bad-result";
 	} else if (!("value" in commands[command])) {
-		// As usual, if it's not defined we want an exception.
-		beforeDiv.lastChild.className = beforeValue === "Exception"
+		// If it's not defined we want "".
+		beforeDiv.lastChild.className = beforeValue === ""
 			? "good-result"
 			: "bad-result";
-		afterDiv.lastChild.className = afterValue === "Exception"
+		afterDiv.lastChild.className = afterValue === ""
 			? "good-result"
 			: "bad-result";
 	} else {