Use hasOwnProperty in getIsHat/getIsEdgeTriggeredHat

This commit is contained in:
Tim Mickel 2016-08-29 10:03:21 -04:00
parent 40c90bbcc7
commit 3ccfdf3df0

View file

@ -152,7 +152,7 @@ Runtime.prototype.getOpcodeFunction = function (opcode) {
* @return {Boolean} True if the op is known to be a hat. * @return {Boolean} True if the op is known to be a hat.
*/ */
Runtime.prototype.getIsHat = function (opcode) { 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. * @return {Boolean} True if the op is known to be a edge-triggered hat.
*/ */
Runtime.prototype.getIsEdgeTriggeredHat = function (opcode) { Runtime.prototype.getIsEdgeTriggeredHat = function (opcode) {
return opcode in this._hats && this._hats[opcode].edgeTriggered; return this._hats.hasOwnProperty(opcode) &&
this._hats[opcode].edgeTriggered;
}; };
/** /**