Assemblyscript: import externs

Created on 19 Mar 2018  路  4Comments  路  Source: AssemblyScript/assemblyscript

how can one import unresolved externs, like in wast:
(import "console" "log" (func $log_i32 (param i32)))

question

All 4 comments

To achieve the same as in text format above:

namespace console {
  export declare function log(v: i32): void;
}

works, wonderful, thanks.

I just need to adopt utf-16 now
console.logs("HAHA")
 // ACK 0x06 ;)

Should now also be possible to rely on 'ambient' flags being passed around properly, like in:

declare namespace console {
  export function log(v: i32): void;
}

Great question and answer... thank you both.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MaxGraey picture MaxGraey  路  4Comments

DuncanUszkay1 picture DuncanUszkay1  路  3Comments

vladimir-tikhonov picture vladimir-tikhonov  路  4Comments

jarble picture jarble  路  3Comments

drachehavoc picture drachehavoc  路  6Comments