Reintroduce builtin decorator so these can appear anywhere in stdlib again

Avoids wrapping an undocumented function within 'memory.size' for example.
This commit is contained in:
dcodeIO
2018-07-19 02:10:04 +02:00
parent 96411c7398
commit 26e46f6f86
80 changed files with 6889 additions and 7157 deletions

View File

@ -1,12 +1,10 @@
export namespace memory {
export function size(): i32 {
return __memory_size(); // tslint:disable-line
}
@builtin
export declare function size(): i32;
export function grow(pages: i32): i32 {
return __memory_grow(pages); // tslint:disable-line
}
@builtin
export declare function grow(pages: i32): i32;
export function fill(dest: usize, c: u8, n: usize): void { // see: musl/src/string/memset
if (isDefined(__memory_fill)) { __memory_fill(dest, c, n); return; } // tslint:disable-line