Support 'import * as' directives, see #27

This commit is contained in:
dcodeIO
2018-06-12 00:45:19 +02:00
parent f2eb64c0fd
commit 25b433dca9
9 changed files with 213 additions and 51 deletions

View File

@ -45,5 +45,24 @@
)
)
(call $export/ns.two)
(drop
(i32.add
(i32.add
(call $export/add
(i32.const 1)
(i32.const 2)
)
(call $export/sub
(i32.const 2)
(i32.const 3)
)
)
(call $export/mul
(i32.const 3)
(i32.const 1)
)
)
)
(call $export/ns.two)
)
)

View File

@ -1,3 +1,5 @@
/* tslint:disable:no-duplicate-imports */
import {
add,
sub as sub,
@ -11,3 +13,11 @@ import {
add(a, b) + sub(b, c) + mul(c, a);
renamed_ns.two();
import * as other from "./export";
other.add(other.a, other.b) +
other.sub(other.b, other.renamed_c) +
other.renamed_mul(other.renamed_c, other.a);
other.ns.two();

View File

@ -55,5 +55,24 @@
)
)
(call $export/ns.two)
(drop
(i32.add
(i32.add
(call $export/add
(i32.const 1)
(i32.const 2)
)
(call $export/sub
(i32.const 2)
(i32.const 3)
)
)
(call $export/mul
(i32.const 3)
(i32.const 1)
)
)
)
(call $export/ns.two)
)
)