mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-16 01:02:08 -04:00
Use hasOwnProperty
in getIsHat
/getIsEdgeTriggeredHat
This commit is contained in:
parent
40c90bbcc7
commit
3ccfdf3df0
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue