mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-14 16:03:41 +00:00
wasm: fix functions exported through //export
When a function is exported using //export, but also had a //go:wasm-module pragma, the //export name was ignored. The //go:wasm-module doesn't actually do anything besides breaking the export (exported functions don't have a module name). I've refactored and cleaned up the code, and in the process removed this weird edge case.
This commit is contained in:
committed by
Ron Evans
parent
00d46bd25d
commit
d845f1e1b2
Vendored
+13
@@ -62,6 +62,19 @@ func exportedFunctionInSection() {
|
||||
//go:wasmimport modulename import1
|
||||
func declaredImport()
|
||||
|
||||
// Legacy way of importing a function.
|
||||
//
|
||||
//go:wasm-module foobar
|
||||
//export imported
|
||||
func foobarImport()
|
||||
|
||||
// The wasm-module pragma is not functional here, but it should be safe.
|
||||
//
|
||||
//go:wasm-module foobar
|
||||
//export exported
|
||||
func foobarExportModule() {
|
||||
}
|
||||
|
||||
// This function should not: it's only a declaration and not a definition.
|
||||
//
|
||||
//go:section .special_function_section
|
||||
|
||||
Reference in New Issue
Block a user