mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-24 10:37:16 +00:00
Improve error message for missing opcode
This commit is contained in:
parent
999b7d6fa1
commit
cb4ab12128
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