You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+31Lines changed: 31 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,36 @@
1
1
# Changelog
2
2
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
+
forxin pairs({}) do
31
+
end
32
+
```
33
+
3
34
## 0.31.0
4
35
5
36
- **Breaking:** The old annotation syntax (`/*!varArg */`) **no longer works**, the only currently supported syntax is:
0 commit comments