summaryrefslogtreecommitdiffhomepage
path: root/tests/custom/99_bugs/44_compiler_as_from_identifier
blob: 6897cb01fa479ffc255feb3105a892c8ddc0be5f (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
Ensure that `as` and `from` are valid identifiers while their special
meaning in import statements is retained.

-- Testcase --
import { foo as bar } from 'mod';
import * as mod from 'mod';

function fn(as, from) {
	return as + from;
}

as = 1;
from = true;

printf("%.J\n", [
	bar,
	mod,
	fn(1, 2),
	as,
	from
]);
-- End --

-- File mod.uc --
export let foo = false;
export default 'test';
-- End --

-- Args --
-R -L files/
-- End --

-- Expect stdout --
[
	false,
	{
		"foo": false,
		"default": "test"
	},
	3,
	1,
	true
]
-- End --