typescript-to-lua 1.3.4 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/dist/CompilerOptions.d.ts +1 -1
  2. package/dist/CompilerOptions.js +0 -1
  3. package/dist/LuaLib.d.ts +12 -1
  4. package/dist/LuaLib.js +61 -65
  5. package/dist/LuaPrinter.js +9 -8
  6. package/dist/cli/parse.js +5 -0
  7. package/dist/index.d.ts +1 -0
  8. package/dist/index.js +5 -1
  9. package/dist/lualib/ArrayConcat.lua +1 -1
  10. package/dist/lualib/ArrayEntries.lua +1 -1
  11. package/dist/lualib/ArrayEvery.lua +2 -2
  12. package/dist/lualib/ArrayFilter.lua +2 -2
  13. package/dist/lualib/ArrayFind.lua +2 -2
  14. package/dist/lualib/ArrayFindIndex.lua +2 -2
  15. package/dist/lualib/ArrayFlat.lua +1 -1
  16. package/dist/lualib/ArrayFlatMap.lua +2 -2
  17. package/dist/lualib/ArrayForEach.lua +2 -2
  18. package/dist/lualib/ArrayIncludes.lua +1 -1
  19. package/dist/lualib/ArrayIndexOf.lua +1 -1
  20. package/dist/lualib/ArrayIsArray.lua +1 -1
  21. package/dist/lualib/ArrayJoin.lua +1 -1
  22. package/dist/lualib/ArrayMap.lua +2 -2
  23. package/dist/lualib/ArrayPush.lua +1 -1
  24. package/dist/lualib/ArrayReduce.lua +2 -2
  25. package/dist/lualib/ArrayReduceRight.lua +2 -2
  26. package/dist/lualib/ArrayReverse.lua +1 -1
  27. package/dist/lualib/ArraySetLength.lua +1 -1
  28. package/dist/lualib/ArrayShift.lua +1 -1
  29. package/dist/lualib/ArraySlice.lua +1 -1
  30. package/dist/lualib/ArraySome.lua +2 -2
  31. package/dist/lualib/ArraySort.lua +2 -2
  32. package/dist/lualib/ArraySplice.lua +1 -1
  33. package/dist/lualib/ArrayToObject.lua +1 -1
  34. package/dist/lualib/ArrayUnshift.lua +1 -1
  35. package/dist/lualib/Await.lua +13 -13
  36. package/dist/lualib/Class.lua +1 -1
  37. package/dist/lualib/ClassExtends.lua +1 -1
  38. package/dist/lualib/CloneDescriptor.lua +1 -1
  39. package/dist/lualib/Decorate.lua +5 -5
  40. package/dist/lualib/DecorateParam.lua +2 -2
  41. package/dist/lualib/DelegatedYield.lua +1 -1
  42. package/dist/lualib/Delete.lua +1 -1
  43. package/dist/lualib/Error.lua +68 -69
  44. package/dist/lualib/FunctionBind.lua +1 -1
  45. package/dist/lualib/Generator.lua +26 -23
  46. package/dist/lualib/InstanceOf.lua +1 -1
  47. package/dist/lualib/InstanceOfObject.lua +1 -1
  48. package/dist/lualib/Iterator.lua +35 -32
  49. package/dist/lualib/Map.lua +131 -129
  50. package/dist/lualib/MathAtan2.lua +1 -1
  51. package/dist/lualib/MathSign.lua +1 -1
  52. package/dist/lualib/New.lua +1 -1
  53. package/dist/lualib/Number.lua +1 -1
  54. package/dist/lualib/NumberIsFinite.lua +1 -1
  55. package/dist/lualib/NumberIsNaN.lua +1 -1
  56. package/dist/lualib/NumberToString.lua +42 -39
  57. package/dist/lualib/ObjectAssign.lua +1 -1
  58. package/dist/lualib/ObjectDefineProperty.lua +1 -1
  59. package/dist/lualib/ObjectEntries.lua +1 -1
  60. package/dist/lualib/ObjectFromEntries.lua +1 -1
  61. package/dist/lualib/ObjectGetOwnPropertyDescriptor.lua +1 -1
  62. package/dist/lualib/ObjectGetOwnPropertyDescriptors.lua +1 -1
  63. package/dist/lualib/ObjectKeys.lua +1 -1
  64. package/dist/lualib/ObjectRest.lua +1 -1
  65. package/dist/lualib/ObjectValues.lua +1 -1
  66. package/dist/lualib/ParseFloat.lua +1 -1
  67. package/dist/lualib/ParseInt.lua +39 -36
  68. package/dist/lualib/Promise.lua +148 -152
  69. package/dist/lualib/PromiseAll.lua +5 -5
  70. package/dist/lualib/PromiseAllSettled.lua +5 -5
  71. package/dist/lualib/PromiseAny.lua +5 -5
  72. package/dist/lualib/PromiseRace.lua +5 -5
  73. package/dist/lualib/Set.lua +120 -118
  74. package/dist/lualib/SetDescriptor.lua +67 -64
  75. package/dist/lualib/SourceMapTraceBack.lua +7 -6
  76. package/dist/lualib/SparseArrayNew.lua +1 -1
  77. package/dist/lualib/SparseArrayPush.lua +1 -1
  78. package/dist/lualib/SparseArraySpread.lua +1 -1
  79. package/dist/lualib/Spread.lua +1 -1
  80. package/dist/lualib/StringAccess.lua +1 -1
  81. package/dist/lualib/StringCharAt.lua +1 -1
  82. package/dist/lualib/StringCharCodeAt.lua +1 -1
  83. package/dist/lualib/StringConcat.lua +1 -1
  84. package/dist/lualib/StringEndsWith.lua +1 -1
  85. package/dist/lualib/StringIncludes.lua +1 -1
  86. package/dist/lualib/StringPadEnd.lua +1 -1
  87. package/dist/lualib/StringPadStart.lua +1 -1
  88. package/dist/lualib/StringReplace.lua +2 -2
  89. package/dist/lualib/StringReplaceAll.lua +4 -4
  90. package/dist/lualib/StringSlice.lua +1 -1
  91. package/dist/lualib/StringSplit.lua +1 -1
  92. package/dist/lualib/StringStartsWith.lua +1 -1
  93. package/dist/lualib/StringSubstr.lua +1 -1
  94. package/dist/lualib/StringSubstring.lua +1 -1
  95. package/dist/lualib/StringTrim.lua +1 -1
  96. package/dist/lualib/StringTrimEnd.lua +1 -1
  97. package/dist/lualib/StringTrimStart.lua +1 -1
  98. package/dist/lualib/Symbol.lua +14 -11
  99. package/dist/lualib/SymbolRegistry.lua +13 -10
  100. package/dist/lualib/TypeOf.lua +1 -1
  101. package/dist/lualib/Unpack.lua +1 -1
  102. package/dist/lualib/WeakMap.lua +41 -39
  103. package/dist/lualib/WeakSet.lua +37 -35
  104. package/dist/lualib/lualib_bundle.lua +1054 -924
  105. package/dist/lualib/lualib_module_info.json +619 -0
  106. package/dist/lualib-build/plugin.d.ts +23 -0
  107. package/dist/lualib-build/plugin.js +138 -0
  108. package/dist/lualib-build/util.d.ts +19 -0
  109. package/dist/lualib-build/util.js +43 -0
  110. package/dist/transformation/builtins/function.js +2 -1
  111. package/dist/transformation/builtins/index.d.ts +1 -0
  112. package/dist/transformation/builtins/index.js +63 -16
  113. package/dist/transformation/context/index.js +5 -1
  114. package/dist/transformation/utils/diagnostics.d.ts +3 -0
  115. package/dist/transformation/utils/diagnostics.js +2 -1
  116. package/dist/transformation/utils/typescript/index.js +5 -1
  117. package/dist/transformation/utils/typescript/types.d.ts +2 -0
  118. package/dist/transformation/utils/typescript/types.js +10 -1
  119. package/dist/transformation/visitors/class/index.js +1 -5
  120. package/dist/transformation/visitors/class/new.d.ts +1 -2
  121. package/dist/transformation/visitors/class/new.js +1 -40
  122. package/dist/transformation/visitors/conditional.js +15 -14
  123. package/dist/transformation/visitors/identifier.js +5 -0
  124. package/dist/transformation/visitors/literal.js +22 -0
  125. package/dist/transformation/visitors/modules/import.js +4 -14
  126. package/dist/transpilation/bundle.js +1 -1
  127. package/dist/transpilation/index.js +5 -1
  128. package/dist/transpilation/plugins.d.ts +11 -0
  129. package/dist/transpilation/transpile.js +13 -0
  130. package/dist/transpilation/transpiler.js +6 -2
  131. package/package.json +12 -11
  132. package/CHANGELOG.md +0 -703
package/CHANGELOG.md DELETED
@@ -1,703 +0,0 @@
1
- # Changelog
2
-
3
- ## 1.3.0
4
-
5
- - Added `LuaPairsIterable` language extension to mark objects as iterable with Lua's `pairs`.
6
- - Added support for properties on functions.
7
- - Unicode is no longer escaped and used as-is for `"luaTarget": "JIT"`.
8
- - Fixed some bugs related to destructuring in loops and function parameters.
9
- - Fixed incorrect global being generated for some `try` statements.
10
- - Fixed some incorrect behavior for `??` and `? :` when generic types were involved.
11
- - Added missing `...` optimization in cases where casts or parentheses are used.
12
- - Fixed a bug for `Promise` when resolving with another Promise. This also fixes some unexpected behavior with `async` which is built with Promises.
13
- - Fixed `async` functions not aborting after returning from a `catch` block.
14
-
15
- ## 1.2.0
16
-
17
- - Upgraded to TypeScript 4.5.x.
18
- - Improved general output formatting.
19
- - Added support for more complicated (nested) destructuring patterns, also fixing an exception they caused before.
20
- - Fixed incorrect interactions between standard library functionality and optional chaining, e.g. `myArray?.forEach()`.
21
- - Fixed rejected promises sometimes not getting the correct rejection reason.
22
- - Fixed some `delete` behavior that was different in Lua compared to JS.
23
- - Fixed a bug causing exported classes to lose their decorators.
24
- - Fixed plugins checking for ts-node from the wrong location (tsconfig directory), plugins will now check for ts-node relative to the tstl directory.
25
-
26
- Under the hood:
27
-
28
- - We can now transform using preceding statements, allowing all kinds of optimizations and improvements to output Lua.
29
- - Updated various language constructs to use preceding statements instead of inline immediately-invoked functions.
30
-
31
- ## 1.1.0
32
-
33
- - **[Breaking]** We now use TypeScript's JSX transformer instead of maintaining our own. As a result, `React.createElement` now requires a self parameter, so remove `@noSelf`, `this: void` if necessary.
34
- - **[Breaking(-ish)]** Due to limitations in 5.1, try/catch can no longer be used in async or generator functions when targetting Lua 5.1. This was already broken but now tstl will explicitly give an error if you try.
35
- - Added support for the `switch` statement in all versions! (Before they were not supported in 5.1 and universal).
36
- - Added support for `string.prototype.replaceAll` and improved `string.prototype.replace` implementation.
37
- - Added `noResolvePaths` tsconfig option to disable module resolution for environment-provided modules.
38
- - Implemented support for void expressions, i.e `void(0)` or `void(ignoreThisReturnValue())`.
39
- - Upgraded TypeScript to 4.4.4 and made it a peer dependency to hopefully avoid plugin issues due to mismatching TypeScript versions.
40
- - The `$vararg` language extension can be used to access CLI arguments, now also in bundles.
41
- - Fixed a bug regarding `baseUrl` and relative imports.
42
- - Fixed `sourceMapTraceback: true` not working correctly for bundles.
43
- - Fixed an issue regarding hoisting in switch case clauses.
44
- - Added missing function context validation cases for object literals.
45
- - Fixed a problem where awaiting rejected promises in try/catch would give the wrong result.
46
- - Fixed an issue where chained `.then` calls on already-resolved or already-rejected promises would cause some callbacks to not fire while they should.
47
- - Fixed source file paths in source maps being absolute, they are now relative again.
48
-
49
- ## 1.0.0
50
-
51
- - **[Breaking]** `/* @tupleReturn */` has been removed and will no longer have any effect. You will get an error if you try ot use it or if you use declarations that use it.
52
- - Added support for the `Promise` class.
53
- - Added support for `async` and `await` using coroutines.
54
- - Module resolution now also correctly resolves `<directory>/init.lua` files for `require("<directory>")`.
55
- - Fixed an error not being thrown when trying to call a method in an optional chain that does not exist. (If the method itself is not optional)
56
- - Fixed a bug where parentheses could break the context parameter being resolved for a method.
57
- - Fixed a bug where context parameters in object literal methods were not inferred correctly.
58
- - Fixed a bug with sourceMapTraceback.
59
- - Fixed TS emitting empty JSON files if you use JSON source files.
60
-
61
- ## 0.42.0
62
-
63
- - **[Breaking]** The `/** @tupleReturn */` is now deprecated, and will be removed next release. If you are still using it, please upgrade to the [LuaMultiReturn language extension](https://typescripttolua.github.io/docs/advanced/language-extensions#luamultireturn-type).
64
- - Added support for JSX, see [documentation](https://typescripttolua.github.io/docs/jsx) for more information.
65
- - Added support for the `baseUrl` configuration key for module resolution.
66
-
67
- A large list of bugfixes:
68
-
69
- - Fixed an exception causing tstl to exit when trying to assign to an optional chain.
70
- - Fixed resolved files appearing duplicated in lua bundles.
71
- - Fixed a problem resolving external Lua files in nested directories.
72
- - Fixed `@noResolution` in library packages losing their NoResolution tag, causing attempts to resolve them for package users.
73
- - Fixed a bug in the bundling code causing modules not to be cached if they return nil (which happens if they are not a module)
74
- - Fixed module resolution trying to incorrectly resolve and rewrite things like `myObject.require()` or `my_custom_require()`.
75
- - Fixed lualib bundle not being included in the output if external packages use it, but the client code does not.
76
-
77
- ## 0.41.0
78
-
79
- - Added support for [optional chaining](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html) `a?.b`, `a?.[b]` and `a?.()`.
80
- - Added an error when trying to bundle a library (`"buildmode": "library"`) project.
81
- - Added `--tstlVerbose` CLI flag to help with diagnosing problems.
82
- - Fixed a bug where vararg (`...`) was not correctly optimized.
83
- - Fixed .tsx files not correctly being resolved.
84
- - Fixed a bug where files were emitted to the wrong location if no `outDir` was specified.
85
-
86
- ## 0.40.0
87
-
88
- - Added support for using external Lua code in your project. This means you can create and install node_modules packages containing Lua code. It also lets you include Lua source files as part of your source files. Used Lua will automatically be added to your output. For more information, see the [External Lua Code](https://typescripttolua.github.io/docs/external-lua-code) page in the docs.
89
- - **[Breaking]** Removed support for deprecated annotations that have been replaced with language extensions: `/** @luaIterator */`, `/** @vararg */`, `/** @luatable */` and `/** forRange */`. If you were still using these, see [the docs](https://typescripttolua.github.io/docs/advanced/compiler-annotations) for instructions how to upgrade.
90
- - Added support for `array.entries()`.
91
- - Added support for `LuaTable.has(key)` and `LuaTable.delete(key)` to the language extensions. See [docs](https://typescripttolua.github.io/docs/advanced/language-extensions#lua-table-types) for more info.
92
- - Made language extension types more strict, disallowing `null` and `undefined` in some places where they would cause problems in Lua.
93
-
94
- - Fixed an issue where using TypeScript transformer plugins would cause invalid namespace and module code, as well as breaking hoisting.
95
- - Fixed invalid switch statement output when the `default` clause was not the last clause in the switch.
96
- - Fixed missing LuaLib dependency when using `string.split`.
97
- - Fixed **lots** of bundling bugs and issues, also added the TypeScriptToLua header to the top of the bundle unless _noHeader_ is specified.
98
-
99
- Under the hood:
100
-
101
- - Various improvements to testing infrastructure for testing (virtual) projects with multiple files.
102
-
103
- ## 0.39.0
104
-
105
- - **[Breaking]** Removed support for `@phantom`, `@metaExtension`, `@extension`, `@pureAbstract` compiler annotations. As of this version **these will no longer function!** For help upgrading your code see [the deprecated annotation docs](https://typescripttolua.github.io/docs/advanced/compiler-annotations#deprecated).
106
- - Added official support for **Lua 5.4**.
107
- - Added the `LuaTable<TKey, TValue>` language extension. This allows the use of barebones Lua tables for key-value storage, without suffering from JS's forced string indexes. For more information see [the LuaTable docs](https://typescripttolua.github.io/docs/advanced/language-extensions#lua-table-types).
108
- - Deprecated `@vararg`. Instead, tstl will figure out itself when use of the Lua ellipsis token (`...`) is appropriate. Also language extension `$vararg` was added to force use of the ellipsis token. See [the docs](https://typescripttolua.github.io/docs/advanced/language-extensions#vararg-constant) for more information.
109
- - Added `trailingComments` and `leadingComments` fields to statements in the Lua AST. These can be modified by plugins to emit comments in the output lua. For an example see [the add-comments test plugin](https://github.com/TypeScriptToLua/TypeScriptToLua/blob/master/test/transpile/plugins/add-comments.ts).
110
-
111
- Under the hood:
112
-
113
- - Tests are now run on a WebAssembly-compiled version of official Lua releases. This means we can now execute test Lua on all Lua versions (except LuaJIT). Shoutout to [Fengari](https://github.com/fengari-lua/fengari) for serving us well for a long time.
114
-
115
- ## 0.38.0
116
-
117
- - **[Breaking]** Renamed `MultiReturn` to `LuaMultiReturn` to be consistent with other language extensions all starting with Lua-.
118
- - Fixed various bugs and issues related to `LuaMultiReturn`, including its value not correctly being wrapped in some cases.
119
- - Added support for indexing `LuaMultiReturn` values without destructing.
120
- - Added language extensions to allow translation directly to (overwritten) Lua operators like `+`,`-`,`..`. For more information see [Operator Map Types](https://typescripttolua.github.io/docs/advanced/language-extensions#operator-map-types).
121
- - Added language extension `$range()`. This function can be used to create numeric lua loops, for example `for (const i of $range(1, 10)) {` translates to `for i=1,10 do`. For more information see [\$range Iterator Function](https://typescripttolua.github.io/docs/advanced/language-extensions#range-iterator-function).
122
- - Added support for `Array.isArray`, formalizing tstl's isArray convention (**note:** Due to `[]` and `{}` being the same in Lua, `{}` - without any keys - is considered an array too.)
123
- - Added support for `string.prototype.includes`.
124
- - Added support for enum merging.
125
- - Fixed missing lualib dependency in `string.prototype.split`.
126
- - Added a not-supported diagnostic for not-yet-implemented optional chaining (`a?.b`).
127
- - Moved remaining legacy tests to modern testing utils, removing the legacy testing code.
128
-
129
- ## 0.37.0
130
-
131
- - **[Important]** Deprecated the @phantom, @extension, @metaExtension and @pureAbstract annotations. This is done because there are good alternatives in regular TypeScript, and this helps us simplify the transpiler. For now, using these annotations will result in a warning but they will still continue to function. A few months from now these annotations will no longer be supported, so upgrade if possible. See [Compiler Annotations](https://typescripttolua.github.io/docs/advanced/compiler-annotations) for more info.
132
- - Added the `MultiReturn<>` type and `$multi()` helper function as the first language extensions. This is to provide a type-safe alternative to the `@tupleReturn` annotation. For more information see [the new Language Extensions page](https://typescripttolua.github.io/docs/advanced/language-extensions) on the docs website.
133
- - Removed some class transformation code from the transpiler that was no longer used.
134
- - Fixed a bug causing object spread to malfunction in some cases ([#898](https://github.com/TypeScriptToLua/TypeScriptToLua/issues/898)).
135
- - Omitted `tostring` for parameters of template literals (`` `${}` ``) that are already known strings.
136
- - Fixed a bug causing incorrect Lua syntax to be generated in some cases ([#944](https://github.com/TypeScriptToLua/TypeScriptToLua/issues/944)).
137
-
138
- ## 0.36.0
139
-
140
- - Upgraded to TypeScript 4.0.
141
- - Added support for `parseInt` and `parseFloat`.
142
- - Added support for `yield*` [for generator functions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/yield*).
143
- - Added support for [method, property and accessor decorators](https://www.typescriptlang.org/docs/handbook/decorators.html).
144
- - Shebangs at the top of a .ts file will now be preserved.
145
- - Fixed an issue causing declarations referencing their own identifier to cause a nil reference error.
146
-
147
- ## 0.35.0
148
-
149
- - In preparation for some new features, some public APIs have been changed:
150
- - High-level APIs that read input files from the file system (`transpileFiles` and `transpileProject`) now write transpiled files by default. This behavior can be changed by providing a `writeFile` callback, similarly to TypeScript's `program.emit`.
151
- - `transpile` and `emitTranspiledFiles` functions have been replaced with the `Transpiler` class. See [documentation](https://typescripttolua.github.io/docs/api/overview#low-level-api) for usage examples.
152
- - Fixed `declarationDir` option not being respected.
153
- - `Function.length` is supported now.
154
- - String iteration is now supported.
155
- - Exposed `parseConfigFileWithSystem` to parse _tsconfig.json_ files as part of the tstl API.
156
- - Fixed `string.replace` incorrectly escaping some `replaceValue` characters (`().+-*?[^$`)
157
- - Fixed several other string operations behaving differently from JS (mostly regarding indices out of bounds and NaN arguments).
158
- - Fixed a bug where the length argument of `String.prototype.substr` was evaluated twice.
159
- - Fixed some missing dependencies in LuaLib classes (Map, Set, WeakMap, WeakSet)
160
-
161
- ## 0.34.0
162
-
163
- - Added new `"luaTarget"` option value - `"universal"`. Choosing this target makes TypeScriptToLua generate code compatible with all supported Lua targets.
164
-
165
- - **BREAKING CHANGE:** This is a new default target. If you have been depending on LuaJIT being chosen implicitly, you now have to enable it explicitly with `"luaTarget": "JIT"` in the `tsconfig.json` file.
166
-
167
- - TypeScript has been updated to **3.9**. See [release notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html) for details. This update includes some fixes specific to our API usage:
168
-
169
- - Importing a non-module using `import "./file"` produced a TS2307 error [#35973](https://github.com/microsoft/TypeScript/issues/35973)
170
- - TypeScript now tries to find a call signature even in presence of type errors [#36665](https://github.com/microsoft/TypeScript/pull/36665):
171
- ```ts
172
- function foo(this: void, x: string) {}
173
- foo(1);
174
- ```
175
- ```lua
176
- -- Before: with 3.8 (this: void ignored due to signature mismatch)
177
- foo(nil, 1)
178
- -- Now: with 3.9
179
- foo(1)
180
- ```
181
-
182
- - Reduced memory consumption and optimized performance of generators and iterators
183
- - Fixed generator syntax being ignored on methods (`*foo() {}`) and function expressions (`function*() {}`)
184
- - Fixed iteration over generators stopping at first yielded `nil` value
185
- - Fixed `Array.prototype.join` throwing an error when array contains anything other than strings and numbers
186
- - Fixed extending a class not keeping `toString` implementation from a super class
187
-
188
- - Fixed issue where CLI arguments were incorrectly removed.
189
- - Fixed issue where class accessors threw an error due to a missing dependency.
190
-
191
- Under the hood:
192
-
193
- - Upgraded to Prettier 2.0
194
-
195
- ## 0.33.0
196
-
197
- - Added support for nullish coalescing `A ?? B`.
198
- - Annotation `/** @noSelf */` now also works directly on function declarations, not only on classes/interfaces.
199
- - Fixed incorrect file paths in source maps.
200
- - Fixed unknown node kind throwing an error instead of diagnostic.
201
- - Fixed string index with side-effects being evaluated twice.
202
- - Added check for node.js version when running tstl.
203
- - Fixed some issues with reflection class names.
204
-
205
- - Fixed incorrectly escaped variable names.
206
-
207
- Under the hood:
208
-
209
- - Switched from TSLint to ESLint.
210
- - Added benchmarking capability for garbage collection.
211
-
212
- ## 0.32.0
213
-
214
- - **Deprecated:** The `noHoisting` option has been removed, hoisting will always be done.
215
-
216
- - TypeScript has been updated to 3.8. See [release notes](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-8.html) for details.
217
-
218
- - Fixed class accessors not working when base class is lacking type information (#725)
219
-
220
- - Class extension code has been extracted to lualib
221
-
222
- ```ts
223
- class A {}
224
- class B extends A {}
225
- ```
226
-
227
- ```diff
228
- A = __TS__Class()
229
- B = __TS__Class()
230
- -B.____super = A
231
- -setmetatable(B, B.____super)
232
- -setmetatable(B.prototype, B.____super.prototype)
233
- +__TS__ClassExtends(A, B)
234
- ```
235
-
236
- - Generated code for class accessors is more dynamic now
237
-
238
- ```ts
239
- class A {
240
- get a() {
241
- return true;
242
- }
243
- }
244
- ```
245
-
246
- ```diff
247
- A = __TS__Class()
248
- -A.prototype.____getters = {}
249
- -A.prototype.__index = __TS__Index(A.prototype)
250
- -function A.prototype.____getters.a(self)
251
- - return true
252
- -end
253
- +__TS__SetDescriptor(
254
- + A.prototype,
255
- + "a",
256
- + {
257
- + get = function(self)
258
- + return true
259
- + end
260
- + }
261
- +)
262
- ```
263
-
264
- This change simplifies our codebase and opens a path to object accessors implementation
265
-
266
- - 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:
267
-
268
- ```ts
269
- for (var x in []) {
270
- }
271
- ```
272
-
273
- ```shell
274
- $ tstl file.ts
275
- file.ts:1:1 - error TSTL: Iterating over arrays with 'for ... in' is not allowed.
276
- file.ts:1:6 - error TSTL: `var` declarations are not supported. Use `let` or `const` instead.
277
-
278
- $ cat file.lua
279
- for x in pairs({}) do
280
- end
281
- ```
282
-
283
- - Added `tstl.luaPlugins` option, allowing to specify plugins in a `tsconfig.json` file:
284
-
285
- ```json
286
- {
287
- "tstl": {
288
- "luaPlugins": [{ "name": "./plugin.ts" }]
289
- }
290
- }
291
- ```
292
-
293
- - Added support for all valid TS `for ... of` loop variable patterns.
294
-
295
- - Fixed a bug where spread expressions in array literals were not correctly translated:
296
-
297
- ```diff
298
- - [1, ...[2, 3], 4] // --> { 1, 2, 4 }
299
- + [1, ...[2, 3], 4] // --> { 1, 2, 3, 4 }
300
-
301
- - ((...values) => values)(1, ...[2, 3], 4) // --> { 1, 2, 4 }
302
- + ((...values) => values)(1, ...[2, 3], 4) // --> { 1, 2, 3, 4 }
303
- ```
304
-
305
- - Fixed Lua error when left hand side of `instanceof` was not a table type.
306
-
307
- - Fixed `sourcemapTraceback` function returning a value different from the standard Lua result in 5.1.
308
-
309
- - Fixed missing LuaLib dependency for Error LuaLib function.
310
-
311
- - Fixed several issues with exported identifiers breaking `for ... in` loops and some default class code.
312
-
313
- - Fixed overflowing numbers transforming to undefined Infinity, instead they are now transformed to `math.huge`.
314
-
315
- ## 0.31.0
316
-
317
- - **Breaking:** The old annotation syntax (`/* !varArg */`) **no longer works**, the only currently supported syntax is:
318
-
319
- `/** @varArg */`.
320
-
321
- - **Breaking:** Fixed some cases where variables were **incorrectly** not labeled `local`. The only variables that are implicitly put in the global context are _top-level variables in non-module files, without any imports or exports in their file_.
322
-
323
- - Moved handling of parentheses out of the transformers and unified this logic in the printer. This might result in some more parentheses in the generated code, but also makes it more correct and fixes some related bugs.
324
-
325
- - Added support for `array.includes`.
326
-
327
- - Fixed a bug breaking global augmentation.
328
-
329
- - Fixed hoisting breaking if there were synthetic nodes in the AST (i.e. when a TS transformer modified the AST).
330
-
331
- ## 0.30.0
332
-
333
- - **Breaking:** We dropped support for `var` variables. If you still have any `var` variable declarations, please use `let` or `const` instead.
334
- - **Breaking:** We now depend on Node.js >= 12.13.0
335
- - Added support for string `trimLeft`, `trimRight`, `trimStart` and `trimEnd`.
336
- - Added support for `console.error`, `console.warn` and `console.info` , they will all be transpiled to Lua's `print`.
337
- - Avoided exporting anonymous identifiers.
338
- - Fixed an issue when assigning to an already-exported variable.
339
- - Math.atan2 will now be transpiled to the correct Lua atan2 (or atan for 5.3) method.
340
- - Fixed various destructuring issues.
341
- - Fixed incorrect error for intersection types containing built-ins (like `number` or `string`)
342
- - Modules containing `import` or `export` will now always be recognized as module to match TypeScript's logic.
343
- - Fixed `true` not being recognized as lua keyword.
344
- - Fixed inaccuracies in switch case variable scoping.
345
- - Fixed various problems with variables being global instead of local.
346
-
347
- ### Internal:
348
-
349
- - Refactored transformation pipeline from one big LuaTransformer class to many small modules.
350
- - Moved class construction methods from transformer to LuaLib.
351
- - Upgraded dependencies.
352
-
353
- ## 0.29.0
354
-
355
- - Added bundling support using options `luaBundle` and `luaBundleEntry` (so **not** TS's outFile). This will bundle all output files into one single bundle file, with _luaBundleEntry_ as entry point. For more information on these options see https://github.com/TypeScriptToLua/TypeScriptToLua/wiki#tstl-specific-options
356
- - Added support for `Number.prototype.toString(radix)`.
357
- - Fixed `array.flat()` not flattening empty arrays.
358
- **Note:** Due to language restrictions, flat will also flatten _objects_ without keys (or only undefined values) so be careful.
359
- For more info on this issue see https://github.com/TypeScriptToLua/TypeScriptToLua/pull/737
360
- - Fixed runtime error when throwing non-string errors and `sourceMapTraceback`.
361
-
362
- ## 0.28.0
363
-
364
- - We now have a `noImplicitSelf` option you can add to your tstl tsconfig.json. Default behavior is `false`. Setting this option to `true` will cause no 'self' arguments to be considered/generated in the project. Declarations will behave as if they have a `/** @noSelfInFile */` directive. This option is new and might cause correctness issues, use at your own risk and create an issue if you experience any issues.
365
- - Regular `Error` objects can now be thrown, `throw` is no longer limited to only strings. Take care: printing/toString'ing the LuaLib error class might have different results for different Lua versions.
366
- - Added LuaLib support for `array.reduceRight`.
367
- - Added LuaLib support for `array.find`.
368
-
369
- - Fixed an issue in test code causing some inconsistent behavior between JS <-> Lua to go unnoticed. Also fixed `array.splice` and `array.join` whose Lua versions behaved differently from the ECMAScript specification.
370
- - Fixed array.reduce not behaving according to ECMAScript specification.
371
- - Fixed order of operations issue with ternary conditional.
372
-
373
- - Updated to TS 3.6.
374
- - Moved from Travis+Appveyor to GitHub Actions!
375
-
376
- ## 0.27.0
377
-
378
- - Added support for [array and object destructuring with rest](https://basarat.gitbooks.io/typescript/content/docs/destructuring.html#object-destructuring-with-rest).
379
- - Changed Map and Set implementations to they preserve insertion order when iterated over, as specified by ECMAScript.
380
-
381
- - Fixed an issue with [`/** @luaTable */`](https://github.com/TypeScriptToLua/TypeScriptToLua/wiki/Compiler-Directives#luaTable) variable names disappearing.
382
- - Fixed for-in loops throwing an error when using a pre-defined variable.
383
- - Fixed issue with initialization order of class properties.
384
-
385
- - Simplified enum transformation code.
386
-
387
- ## 0.26.0
388
-
389
- - Added support for [default exports and export equals statements](https://github.com/Microsoft/TypeScript/issues/7185#issuecomment-421632656).
390
- - Added support for [object spread expressions](https://mariusschulz.com/blog/object-rest-and-spread-in-typescript).
391
- - Added support for most common [destructuring assignments](https://basarat.gitbooks.io/typescript/content/docs/destructuring.html).
392
- - Added support for omitted declarations in destructuring tuples. (i.e. `const [a,,c] = foo();`)
393
-
394
- - `@noSelf` now only applies to members of the namespace with the directive, in case of namespace merging.
395
- - Fixed issue with isNumerType causing enum members as array indices not to recieve the `+1`.
396
- - Fixed string.indexOf failing in case the search string was a Lua string pattern.
397
- - Fixed some crashes from recursive type constraints.
398
-
399
- - Some simplification to the printing of expression statements.
400
- - Added new testing util methods to improve the testing process.
401
-
402
- ## 0.25.0
403
-
404
- - Added support for named function assignments, i.e. `const myFunc = function x(n) { ...; return x(n - 1); }`
405
-
406
- - Made detection of string methods more robust.
407
- - Fixed issue regarding readonly tuple detection.
408
- - Fixed a nasty issue causing exponential complexity on chained properties/method expressions.
409
- - Improved handling of constrained generic types related to string and array detection.
410
-
411
- ## 0.24.0
412
-
413
- - Returns in try/catch statements now properly return from the current function.
414
- - TypeScript's `globalThis` is now translated to lua's `_G`. Lualib functions were updated where relevant.
415
-
416
- - Fixed issue where string/table literals were missing parentheses and caused lua syntax errors.
417
- - Various improvements/refactorings across the codebase.
418
- - Fixed syntax error in for...of loops with empty destructuring argument.
419
- - Fixed issue with `do ... while` scope.
420
- - Fixed a bug with [@combileMembersOnly](https://github.com/TypeScriptToLua/TypeScriptToLua/wiki/Compiler-Directives#compilemembersonly) where it would ignore anything before the enum name.
421
-
422
- ## 0.23.0
423
-
424
- - Added support for OmittedExpression in array literals and array binding patterns.
425
- - Added support for [tagged template literals](https://basarat.gitbooks.io/typescript/docs/template-strings.html#tagged-templates).
426
- - Changed output lua formatting to be more debugger-friendly.
427
- - Various improvements to source maps.
428
-
429
- - Fixed an issue with the interaction of super calls and exported classes.
430
- - Fixed `@noResolution` not working on named modules.
431
- - Fixed namespace merging not working due to an earlier change.
432
-
433
- - Some refactoring and plumbing for the website.
434
-
435
- ## 0.22.0
436
-
437
- - Added the [@vararg](https://github.com/TypeScriptToLua/TypeScriptToLua/wiki/Compiler-Directives#vararg) directive.
438
- - Added the [@forRange](https://github.com/TypeScriptToLua/TypeScriptToLua/wiki/Compiler-Directives#forRange) directive.
439
- - Custom ts transformers can now be loaded from tsconfig.
440
-
441
- - Fixed default tstl header incorrectly showing up above lualib functions.
442
- - Some improvements to typeof expressions.
443
-
444
- ## 0.21.0
445
-
446
- - Imports/exports that are ambient (declarations, types, interfaces, etc) or are not used in value positions no longer generate `require` statements.
447
- - For ... of loops are now translated using `ipairs`.
448
- - Added support for `array.reduce`.
449
- - Added support for `import foo = bar.baz;` statements.
450
-
451
- - Fixed some issues with binding pattern parameter default values.
452
- - Fixed some issues with variable naming.
453
- - Enabled prettier on the entire codebase.
454
-
455
- ## 0.20.0
456
-
457
- - Added support for `string.repeat`, `string.padStart` and `string.padEnd`.
458
- - Added automatic variable renaming for invalid Lua identifiers.
459
- - Fixed `/** @tupleReturn */` not working for function types (i.e `myFunc: () => [number, number]`)
460
- - Various improvements to source map output format.
461
- - Various small code tweaks and improvements.
462
-
463
- ## 0.19.0
464
-
465
- - **BREAKING CHANGE:** All tstl-specific options should now be inside the "tstl" section in tsconfig.json (see README.md). **Root-level options are no longer supported**.
466
- - Added a compiler API to programmatically invoke TypeScriptToLua, and to modify or extend the default transpiler. More info on the [Compiler API wiki page](https://github.com/TypeScriptToLua/TypeScriptToLua/wiki/TypeScriptToLua-API).
467
- - Added support for [class decorators](https://www.typescriptlang.org/docs/handbook/decorators.html#class-decorators).
468
- - Added support for the [@luaTable directive](https://github.com/TypeScriptToLua/TypeScriptToLua/wiki/Compiler-Directives#luatable) which will force a class to be transpiled as vanilla lua table.
469
- - Added support for NaN, Infinity and related number functions.
470
- - Added support for string.startsWith, string.endsWith and improved string.replace implementation.
471
- - Added support for Symbol.hasInstance.
472
-
473
- - Hoisting now also considers imports.
474
- - Various improvements to iterators and arrays, they also work with the spread operator now.
475
- - Fixed an issue with parameters that had `false` as default value.
476
-
477
- ## 0.18.0
478
-
479
- - Added support for setting array length. Doing `array.length = x` will set the length of the array to `x` (or shorter, if the starting array was shorter!).
480
- - Added the `.name` property to all transpiled classes, so `class.name` will contain the classname as string.
481
- - Changed `class = class or {}` syntax to just be `class = {}`.
482
- - Cleaned up printer output so it produces more human-readable code.
483
-
484
- - Fixed bug with expression statements.
485
- - Fixed incorrect inline sourcemap format.
486
- - Fixed bug when merging an interface and module.
487
- - Fixed a bug with inherited constructor super call ordering.
488
-
489
- - Enabled strict tsconfig.
490
-
491
- ## 0.17.0
492
-
493
- - We now support source maps in the [standard JS v3 format](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?hl=en_US&pli=1&pli=1). You can generate source maps with the `--sourceMap` CLI argument, or by adding `sourceMap: true` to your tsconfig. Inline source maps are also supported with `--inlineSourceMap` CLI/tsconfig parameter.
494
- - Also added [tstl option](https://github.com/TypeScriptToLua/TypeScriptToLua/wiki#tstl-specific-options) `--sourceMapTraceback`, which will add an override to Lua's `debug.traceback()` to each file, so source maps will automatically be applied to Lua stacktraces (i.e. in errors).
495
-
496
- - Made watch mode incremental.
497
-
498
- - Added support for `Object.fromEntries`, `array.flat` and `array.flatMap`.
499
-
500
- - **BREAKING CHANGE:** Directive `@tupleReturn` should now be specified **per overload**.
501
-
502
- - Fixed a bug where rest parameters would not transpile correctly.
503
- - Fixed an issue with escaped backticks.
504
- - Various small fixes function inference and array detection.
505
-
506
- - Changed testing framework to [jest](https://github.com/facebook/jest).
507
-
508
- ## 0.16.0
509
-
510
- - **BREAKING CHANGE:** All functions now take a `self` parameter. This means that without further action calls to declaration functions might be given an extra argument.
511
- - To remove the self parameter from a single function add `this: void` to its declaration:
512
- `declare function foo(this: void, ...)`
513
- - To remove the self parameter from all methods or functions in a class/interface/namespace add `/** @noSelf */`:
514
- `/** @noSelf */ interface Foo {`
515
- - To remove the self parameter from all functions in a file, add `/** @noSelfInFile */` at the top.
516
-
517
- ---
518
-
519
- - **BREAKING CHANGE:** Directive `/** @luaIterator */` should now be put on types instead of on the functions returning them.
520
-
521
- ---
522
-
523
- - Fixed a bug breaking named class expressions.
524
- - Fixed inconsistency between the meaning of `>>` and `>>>` in JS vs. Lua.
525
- - Added `/** @noResolution */` directive to prevent path resolution on declared modules.
526
- - It is now possible to put `/** @luaIterator */` on types extending `Array<T>`.
527
- - Fixed issue with the moment static fields were initialized.
528
- - Fixed issue where `undefined` as property name was not transpiled correctly.
529
- - Various improvements to function/method self parameter inference.
530
- - Tstl options can now be defined in their own `tstl` block in tsconfig.json. For example:
531
-
532
- ```
533
- {
534
- "compilerOptions" : {}
535
- "tstl": {
536
- "luaTarget": "JIT"
537
- }
538
- }
539
- ```
540
-
541
- - Fixed issue when redeclaring TypeScript libraries/globals.
542
- - Fixed exception resolving function signatures.
543
- - Added support for automatically transpiling several `console` calls to their Lua equivalent:
544
- - `console.log(...)` -> `print(...)`
545
- - `console.assert(...)` -> `assert(...)`
546
- - `console.trace(...)` -> `print(debug.traceback(...))`
547
- - Added support for `array.findIndex()`.
548
- - Fixed `array.sort()` not working with a compare function.
549
- - Added support for several common `Math.` functions and constants.
550
- - Added support for several common string instance functions such as `upper()`.
551
-
552
- ## 0.15.2
553
-
554
- - Several improvements to module path resolution.
555
- - Removed header comment appearing in lualib.
556
- - Several package config improvements.
557
- - Static get/set accessors.
558
-
559
- ## 0.15.1
560
-
561
- - Fixed array detection for unit and intersection types.
562
- - Support for import without `from`.
563
- - Added support for `WeakMap` and `WeakSet`.
564
- - Added support for `Object.keys` and `Object.assign`.
565
- - Added support for importing JSON files.
566
- - Fixed bug with where loop variables were not properly scoped.
567
- - Added support for ExportDeclarations
568
-
569
- ## 0.15.0
570
-
571
- - Now written for TypeScript 3.3.x!
572
- - Removed external CLI parser dependency and wrote our own `CommandLineParser.ts` to read CLI and tsconfig input.
573
- - Added support for hoisting, can be disabled with the `noHoisting` option in CLI or tsconfig.
574
- - Added support for generator functions.
575
- - Reworked classes into a system more similar to JavaScript with prototype tables.
576
- - Improved support for ObjectBindingPatterns.
577
- - Added support for enums with identifier values.
578
- - Added support for the binary comma operator.
579
- - Added support for `string.concat`, `string.slice` and `string.charCodeAt`.
580
- - Refactored LuaTranspiler.emitLuaLib to its own method so it can be called from external code.
581
- - Improved function type inference.
582
- - Fixed some bugs in for loops with expressions.
583
- - Fixed a bug forwarding luaIterator functions.
584
-
585
- ## 0.14.0
586
-
587
- - Reworked internal transpiler structure to be more suited for future extension.
588
- - Reworked module and exports system.
589
- - Added support for custom iterators.
590
- - Improved formatting consistency.
591
- - Errors are now reported with location `(line, column)` instead of `line: line, column: column`.
592
- - Added back default lua header: `--[[ Generated with https://github.com/Perryvw/TypescriptToLua ]]`.
593
- - Fixed some bugs with switches and breaks.
594
- - Fixed several bugs with functions and context parameters.
595
-
596
- ## 0.13.0
597
-
598
- - Reworked how functions are transpiled, see https://github.com/TypeScriptToLua/TypescriptToLua/wiki/Differences-Between-Functions-and-Methods
599
- - Improved handling of types extending Array.
600
- - Fixed several bugs with classes.
601
- - Fixed issues with inherited accessors.
602
-
603
- ## 0.12.0
604
-
605
- - Added detection of types extending Array.
606
- - Added new JSDoc-style compiler directives, deprecated the old `!` decorators, see https://github.com/TypeScriptToLua/TypescriptToLua/wiki/Compiler-Directives
607
- - Fixed bug with constructor default values.
608
- - The Lualib is no longer included when not used.
609
- - Fixed bug with unpack in LuaJIT.
610
-
611
- ## 0.11.0
612
-
613
- - Fixed bug when throwing anything that was not a string. (@tomblind)
614
- - Added support for object literal method declarations. (@tomblind)
615
- - Fixed several issues with assignment operators (@tomblind)
616
- - `else if` statements are now transpiled to Lua `elseif` instead of nested ifs statements. (@tomblind)
617
- - Occurrences of const enum values are now directly replaced with their value in the Lua output. (@DoctorGester)
618
- - Rethrowing is now possible from try/catch blocks (@tomblind)
619
- - Destructing statements in LuaJit now use `unpack` instead of `table.unpack`
620
- - Removed support for switch statements for versions <= 5.1.
621
- - Refactored `for ... of` translation, it now uses numeric `for` loops instead of `ipairs` for performance reasons.
622
-
623
- ## 0.10.0
624
-
625
- - Added support for NonNullExpression (`abc!` transforming the type from `abc | undefined` to `abc`)
626
- - Added expression position to replacement binary expression to improve error messages.
627
- - Fixed various issues with !TupleReturn (@tomblind)
628
- - Added support for `array.reverse`, `array.shift`, `array.unshift`, `array.sort`. (@andreiradu)
629
- - Added translation for `Object.hasOwnProperty()`. (@andreiradu)
630
- - Added support for class expressions (@andreiradu)
631
- - Fixed bug in detecting array types (@tomblind)
632
- - Added public API functions and better webpack functionality.
633
-
634
- ## 0.9.0
635
-
636
- - Fixed an issue where default parameter values were ignored in function declarations.
637
- - Fixed a bug where `self` was undefined in function properties.
638
- - Fixed a bug where addition of +1 to indices sometimes caused issues with operation order (thanks @brianhang)
639
- - Fixed super calls having issues with their `self` instance. (thanks @hazzard993)
640
- - Methods now also accept custom decorators (thanks @hazzard993)
641
- - Improved support for `toString` calls (thanks @andreiradu)
642
- - Added support for block expressions (thanks @andreiradu)
643
-
644
- Thanks @tomblind for the following changes:
645
-
646
- - Fixed a bug where recursive use of a function expression caused a nil error.
647
- - Fixed syntax error when compiling variable declaration lists.
648
- - Fixed an issue with assignment order in exported namespaces.
649
- - Various fixes to `!TupleReturn` functions.
650
- - Fixed an issue with declaration merging.
651
-
652
- ## 0.8.0
653
-
654
- - Added experimental watch mode, use it with `tstl --watch`
655
- - Refactored decorators
656
- - Added `...` spread operator
657
- - Added error when a lua keyword is used as variable name
658
- - Added support for shorthand object literals (thanks @gakada)
659
- - Added array.pop (thanks @andreiradu)
660
- - Added `;` after lines to avoid ambiguous syntax (thanks @andreiradu)
661
- - Fixed issue with tsconfig being overriden (thanks @Janne252)
662
-
663
- ## 0.7.0
664
-
665
- - Lualib runtime library is now compiled from TypeScript using the transpiler when building!
666
- - Split up runtime library definition into individual files.
667
- - Added multiple inclusion modes using the tsconfig option `lubLibImport`, options are:
668
- - `require` : Requires the entire library if lualib features are used.
669
- - `always` : Always require the runtime library.
670
- - `inline` : Inline the library code for used features in the file.
671
- - `none` : Do not include the runtime library
672
- - Added support for assigning expressions (`+=`, `&=`, `++`, etc) in other expressions (i.e. `lastIndex = i++` or `return a += b`) by transpiling them as immediately called anonymous functions.
673
- - Unreachable code (after returns) is no longer transpiled, preventing a Lua syntax error.
674
- - Fixed issue with destructing statements in Lua 5.1
675
- - Fixed issue with escaped characters in strings.
676
- - Fixed bug regarding changing an exported variable after its export.
677
-
678
- ## 0.6.0
679
-
680
- - Reworked part of the class system to solve some issues.
681
- - Reworked class tests from translation to functional.
682
- - Fixed issue with Lua splice implementation.
683
- - Added threaded test runner to use for faster testing (use with `npm run test-threaded`).
684
- - Added support for string-valued enums.
685
- - Added tsconfig values to target Lua 5.1 and 5.2.
686
-
687
- ## 0.5.0
688
-
689
- - Added support for `**` operator.
690
- - Added support for `~` operator.
691
- - Improved handling of assignment binary operators (`+=`,`*=`,`&=`, etc).
692
- - Rewrote `Map` and `Set` to implement the ES6 specification for [Map](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) and [Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set).
693
- - Added support for `baseUrl` in [tsconfig](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html).
694
- - Added `bit32` bit operations for Lua 5.2.
695
- - Fixed various little bugs.
696
- - Added tslint rule to enforce use of `/** @override */` decorator.
697
- - Improved tests.
698
-
699
- ## 0.4.0
700
-
701
- - Added support for `typeof`
702
- - Added support for `instanceof`
703
- - Added support for [TypeScript overloads](https://www.typescriptlang.org/docs/handbook/functions.html#overloads)