You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently Instance only exposes export("name") for function. We should also export tables, globals, memory
Instead of polluting the class namespace with multiple exportGlobal, exportTable, etc. we propose to instead have an .exports() with multiple members, e.g. exports().function("name") etc.
This way we could also have exports().functionType("name") etc. since accessing each exported member type is also a real chore.
The strategy could be to have an inner non-static class as a member to Instance; non-static so that it can easily access the Instance members without having to pass them to its constructor; e.g.
classInstance {
SomeFieldf;
publicclassExports() {
Functionfunction(Stringname) {
// `f` is accessible here
}
}
}
We might keep Instance#export("name") available both for compatibility and because getting an exported function is a frequent operation.
The text was updated successfully, but these errors were encountered:
Currently
Instance
only exposesexport("name")
for function. We should also export tables, globals, memoryInstead of polluting the class namespace with multiple
exportGlobal
,exportTable
, etc. we propose to instead have an.exports()
with multiple members, e.g.exports().function("name")
etc.This way we could also have
exports().functionType("name")
etc. since accessing each exported member type is also a real chore.The strategy could be to have an inner non-static class as a member to
Instance
; non-static so that it can easily access theInstance
members without having to pass them to its constructor; e.g.We might keep
Instance#export("name")
available both for compatibility and because getting an exported function is a frequent operation.The text was updated successfully, but these errors were encountered: