Skip to content

Commit 9eaa4ad

Browse files
committed
Add changelog entry
1 parent 51574a8 commit 9eaa4ad

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

CHANGELOG.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,36 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
- Errors reported during transpilation now are created as TypeScript diagnostics, instead of being thrown as JavaScript errors. This makes TypeScriptToLua always try to generate valid code (even in presence of errors) and allows multiple errors to be reported in a single file:
6+
7+
<!-- prettier-ignore -->
8+
```ts
9+
for (var x in []) {}
10+
```
11+
12+
```shell
13+
# Before
14+
15+
$ tstl file.ts
16+
file.ts:1:1 - error TSTL: Iterating over arrays with 'for ... in' is not allowed.
17+
18+
$ cat file.lua
19+
error("Iterating over arrays with 'for ... in' is not allowed.")
20+
```
21+
22+
```shell
23+
# Now
24+
25+
$ tstl file.ts
26+
file.ts:1:1 - error TSTL: Iterating over arrays with 'for ... in' is not allowed.
27+
file.ts:1:6 - error TSTL: `var` declarations are not supported. Use `let` or `const` instead.
28+
29+
$ cat file.lua
30+
for x in pairs({}) do
31+
end
32+
```
33+
334
## 0.31.0
435
536
- **Breaking:** The old annotation syntax (`/* !varArg */`) **no longer works**, the only currently supported syntax is:

0 commit comments

Comments
 (0)