Browse Source

Add inspect method to Opcode.

patch-2
Trevin Hofmann 10 years ago
parent
commit
5bb750252d
  1. 9
      lib/opcode.js

9
lib/opcode.js

@ -233,4 +233,13 @@ Opcode.isSmallIntOp = function(opcode) {
((opcode >= Opcode.map.OP_1) && (opcode <= Opcode.map.OP_16)));
};
/**
* Will return a string formatted for the console
*
* @returns {String} Script opcode
*/
Opcode.prototype.inspect = function() {
return '<Opcode: ' + this.toString() + ', hex: '+this.toHex()+', decimal: '+this.num+'>';
};
module.exports = Opcode;

Loading…
Cancel
Save