Removes api.ImportRenamer for a different approach to "env" (#680)
Before, we introduced a type `api.ImportRenamer` to resolve conflicts where the "env" module was shared between AssemblyScript and user-defined functions. This API was never used in GitHub, and is complicated. AssemblyScript also isn't the only ABI to share the "env" module, as other web APIs like Emscripten do also. The less complicated approach is to have packages that need to share "env" use `ModuleBuilder.ExportFunctions` instead, and use namespaces as needed if there is overlap. Signed-off-by: Adrian Cole <adrian@tetrate.io>
This commit is contained in:
@@ -174,13 +174,6 @@ func (r *runtime) CompileModule(ctx context.Context, binary []byte, cConfig Comp
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Replace imports if any configuration exists to do so.
|
||||
if importRenamer := config.importRenamer; importRenamer != nil {
|
||||
for _, i := range internal.ImportSection {
|
||||
i.Module, i.Name = importRenamer(i.Type, i.Module, i.Name)
|
||||
}
|
||||
}
|
||||
|
||||
internal.AssignModuleID(binary)
|
||||
|
||||
if err = r.store.Engine.CompileModule(ctx, internal); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user