mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-28 12:36:35 +00:00
Improve error message for missing opcode
This commit is contained in:
parent
78906d6f4c
commit
646f8cfa52
1 changed files with 6 additions and 2 deletions
|
|
@ -12,8 +12,12 @@ const PRIMITIVE_TYPES = {
|
|||
|
||||
// TODO: Don't depend upon COMMANDS
|
||||
function opcodeToArgType(opcode) {
|
||||
const argType = COMMANDS[opcode].arg;
|
||||
switch (argType) {
|
||||
const command = COMMANDS[opcode];
|
||||
if (command == null) {
|
||||
throw new Error(`Unknown opcode ${opcode}`);
|
||||
}
|
||||
|
||||
switch (command.arg) {
|
||||
case "func":
|
||||
case "line":
|
||||
return "COMMAND_OFFSET";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue