Class: Wardite::Exports

Inherits:
Object
  • Object
show all
Defined in:
lib/wardite.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(export_section, store) ⇒ Exports

Returns a new instance of Exports.



1248
1249
1250
1251
1252
1253
1254
# File 'lib/wardite.rb', line 1248

def initialize(export_section, store)
  @mappings = {}
  export_section.exports.each_pair do |name, desc|
    # TODO: introduce map by kind
    @mappings[name] = [desc.kind, store.funcs[desc.func_index]]
  end
end

Instance Attribute Details

#mappingsObject

: Hash[String, [Integer, WasmFunction|ExternalFunction]]



1243
1244
1245
# File 'lib/wardite.rb', line 1243

def mappings
  @mappings
end

Instance Method Details

#[](name) ⇒ Object



1258
1259
1260
# File 'lib/wardite.rb', line 1258

def [](name)
  @mappings[name]
end