diff --git a/src/engine/runtime.js b/src/engine/runtime.js
index 8283bdf5e..9ddf20509 100644
--- a/src/engine/runtime.js
+++ b/src/engine/runtime.js
@@ -152,7 +152,7 @@ Runtime.prototype.getOpcodeFunction = function (opcode) {
  * @return {Boolean} True if the op is known to be a hat.
  */
 Runtime.prototype.getIsHat = function (opcode) {
-    return opcode in this._hats;
+    return this._hats.hasOwnProperty(opcode);
 };
 
 /**
@@ -161,7 +161,8 @@ Runtime.prototype.getIsHat = function (opcode) {
  * @return {Boolean} True if the op is known to be a edge-triggered hat.
  */
 Runtime.prototype.getIsEdgeTriggeredHat = function (opcode) {
-    return opcode in this._hats && this._hats[opcode].edgeTriggered;
+    return this._hats.hasOwnProperty(opcode) &&
+        this._hats[opcode].edgeTriggered;
 };
 
 /**