|
1 | 1 | # Changelog |
2 | 2 |
|
3 | | -## Unreleased |
| 3 | +## 0.32.0 |
| 4 | + |
| 5 | +- **Deprecated:** The `noHoisting` option has been removed, hoisting will always be done. |
4 | 6 |
|
5 | 7 | - TypeScript has been updated to 3.8. See [release notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html) for details. |
6 | 8 |
|
|
52 | 54 |
|
53 | 55 | This change simplifies our codebase and opens a path to object accessors implementation |
54 | 56 |
|
55 | | -- 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: |
| 57 | +- 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: |
56 | 58 |
|
57 | | - <!-- prettier-ignore --> |
58 | 59 | ```ts |
59 | | - for (var x in []) {} |
60 | | - ``` |
61 | | - |
62 | | - ```shell |
63 | | - # Before |
64 | | - |
65 | | - $ tstl file.ts |
66 | | - file.ts:1:1 - error TSTL: Iterating over arrays with 'for ... in' is not allowed. |
67 | | - |
68 | | - $ cat file.lua |
69 | | - error("Iterating over arrays with 'for ... in' is not allowed.") |
| 60 | + for (var x in []) { |
| 61 | + } |
70 | 62 | ``` |
71 | 63 |
|
72 | 64 | ```shell |
73 | | - # Now |
74 | | - |
75 | 65 | $ tstl file.ts |
76 | 66 | file.ts:1:1 - error TSTL: Iterating over arrays with 'for ... in' is not allowed. |
77 | 67 | file.ts:1:6 - error TSTL: `var` declarations are not supported. Use `let` or `const` instead. |
|
91 | 81 | } |
92 | 82 | ``` |
93 | 83 |
|
| 84 | +- Added support for all valid TS `for ... of` loop variable patterns. |
| 85 | +
|
| 86 | +- Fixed a bug where spread expressions in array literals were not correctly translated: |
| 87 | +
|
| 88 | + ```diff |
| 89 | + - [1, ...[2, 3], 4] // --> { 1, 2, 4 } |
| 90 | + + [1, ...[2, 3], 4] // --> { 1, 2, 3, 4 } |
| 91 | + |
| 92 | + - ((...values) => values)(1, ...[2, 3], 4) // --> { 1, 2, 4 } |
| 93 | + + ((...values) => values)(1, ...[2, 3], 4) // --> { 1, 2, 3, 4 } |
| 94 | + ``` |
| 95 | +
|
| 96 | +- Fixed Lua error when left hand side of `instanceof` was not a table type. |
| 97 | +
|
| 98 | +- Fixed `sourcemapTraceback` function returning a value different from the standard Lua result in 5.1. |
| 99 | +
|
| 100 | +- Fixed missing LuaLib dependency for Error LuaLib function. |
| 101 | +
|
| 102 | +- Fixed several issues with exported identifiers breaking `for ... in` loops and some default class code. |
| 103 | +
|
| 104 | +- Fixed overflowing numbers transforming to undefined Infinity, instead they are now transformed to `math.huge`. |
| 105 | +
|
94 | 106 | ## 0.31.0 |
95 | 107 |
|
96 | 108 | - **Breaking:** The old annotation syntax (`/* !varArg */`) **no longer works**, the only currently supported syntax is: |
|
0 commit comments