Don't throw exceptions for unrecognized commands
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Sun, 19 Jun 2011 10:37:45 -0600
changeset 289 ab23b599b7f1
parent 288 f4f42eeb6c35
child 290 443821c02635
Don't throw exceptions for unrecognized commands

(in implementation.js, not the spec)
implementation.js
--- a/implementation.js	Sun Jun 19 10:15:13 2011 -0600
+++ b/implementation.js	Sun Jun 19 10:37:45 2011 -0600
@@ -498,6 +498,10 @@
 		return;
 	}
 
+	if (!(command in commands)) {
+		return;
+	}
+
 	commands[command].action(value);
 
 	globalRange = null;
@@ -516,6 +520,10 @@
 		return;
 	}
 
+	if (!(command in commands)) {
+		return;
+	}
+
 	return commands[command].state();
 
 	globalRange = null;
@@ -534,6 +542,10 @@
 		return;
 	}
 
+	if (!(command in commands)) {
+		return;
+	}
+
 	return commands[command].value();
 
 	globalRange = null;