diff --git a/lib/opcode.js b/lib/opcode.js index 417213d..04c3ccf 100644 --- a/lib/opcode.js +++ b/lib/opcode.js @@ -33,7 +33,10 @@ Opcode.prototype.fromString = function(str) { }; Opcode.prototype.toString = function() { - return Opcode.reverseMap[this.num]; + var str = Opcode.reverseMap[this.num]; + if (typeof str === 'undefined') + throw new Error('Opcode does not have a string representation'); + return str; }; Opcode.map = {