mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
js: support WASM interoperability using wasm_import/wasm_export fn tags (#12212)
This commit is contained in:
@@ -195,6 +195,7 @@ fn (mut p Parser) fn_decl() ast.FnDecl {
|
||||
'direct_array_access' { is_direct_arr = true }
|
||||
'keep_args_alive' { is_keep_alive = true }
|
||||
'export' { is_exported = true }
|
||||
'wasm_export' { is_exported = true }
|
||||
'unsafe' { is_unsafe = true }
|
||||
'trusted' { is_trusted = true }
|
||||
'c2v_variadic' { is_c2v_variadic = true }
|
||||
|
||||
@@ -1502,7 +1502,7 @@ fn (mut p Parser) attributes() {
|
||||
for p.tok.kind != .rsbr {
|
||||
start_pos := p.tok.position()
|
||||
attr := p.parse_attr()
|
||||
if p.attrs.contains(attr.name) {
|
||||
if p.attrs.contains(attr.name) && attr.name != 'wasm_export' {
|
||||
p.error_with_pos('duplicate attribute `$attr.name`', start_pos.extend(p.prev_tok.position()))
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user