summaryrefslogtreecommitdiffhomepage
path: root/tests/custom/04_modules/01_export_variable_declaration
blob: 19a1c11ece1d106cca219c303aaf31375c8482f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Variable declarations can be prepended with `export` to automatically
export each variable using the same name as the variable itself.

Updates to the variable after the export are reflected properly in
the including scope.

-- File test-var-decl.uc --
export let a, b, c;
export let d = 4, e = 5, f = 6;
export const g = 7, h = 8, i = 9;

a = 1;
b = 2;
c = 3;
-- End --

-- Testcase --
import { a, b, c, d, e, f, g, h, i } from "./files/test-var-decl.uc";

print([ a, b, c, d, e, f, g, h, i ], "\n");
-- End --

-- Args --
-R
-- End --

-- Expect stdout --
[ 1, 2, 3, 4, 5, 6, 7, 8, 9 ]
-- End --