mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-06-13 06:51:34 +00:00
Support 'import * as' directives, see #27
This commit is contained in:
@ -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)
|
||||
)
|
||||
)
|
||||
|
@ -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();
|
||||
|
@ -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)
|
||||
)
|
||||
)
|
||||
|
Reference in New Issue
Block a user