Fix Opera breakage
authorAryeh Gregor <AryehGregor+gitcommit@gmail.com>
Sun, 24 Jul 2011 13:10:06 -0600
changeset 450 7b57df8ca2ed
parent 449 c0dda58e445c
child 451 80f3db3d3c43
Fix Opera breakage

Opera 11.50 doesn't support ES5 >:(
implementation.js
--- a/implementation.js	Sun Jul 24 12:01:11 2011 -0600
+++ b/implementation.js	Sun Jul 24 13:10:06 2011 -0600
@@ -7405,8 +7405,17 @@
 };
 //@}
 
-//@{ Some final setup
-Object.keys(commands).forEach(function(command) {
+// Some final setup
+//@{
+(function() {
+// Opera 11.50 doesn't implement Object.keys, so I have to make an explicit
+// temporary, which means I need an extra closure to not leak the temporaries
+// into the global namespace.  >:(
+var commandNames = [];
+for (var command in commands) {
+	commandNames.push(command);
+}
+commandNames.forEach(function(command) {
 	// "If a command does not have a relevant CSS property specified, it
 	// defaults to null."
 	if (!("relevantCssProperty" in commands[command])) {
@@ -7491,6 +7500,7 @@
 		};
 	}
 });
+})();
 //@}
 
 // vim: foldmarker=@{,@} foldmethod=marker