diff --git a/asm.js b/asm.js index 5f4a556..705f04a 100644 --- a/asm.js +++ b/asm.js @@ -947,6 +947,9 @@ export class Assembler { ?? this.lookup_param(func, action.symbol) ?? this.lookup_local(func, action.symbol) ?? this.lookup_global(action.symbol) + ?? this.lookup_table(action.symbol) + ?? this.lookup_type(action.symbol) + ?? this.lookup_func(action.symbol) if (value == null) { const def_value = this.lookup_def(action.symbol); if (def_value == null) { @@ -1092,6 +1095,20 @@ export class Assembler { return index == -1 ? null : index; } + lookup_table(symbol) { + const index = Object.keys(this.tables).indexOf(symbol); + return index == -1 ? null : index; + } + + lookup_type(symbol) { + return this.type_bindings[symbol]; + } + + lookup_func(symbol) { + const index = Object.keys(this.funcs).indexOf(symbol); + return index == -1 ? null : index; + } + lookup_def(symbol) { return this.defs[symbol]; }