Skip to content

Commit be21c8d

Browse files
committed
1.5.0
2 parents 92bb90b + 1e81749 commit be21c8d

File tree

117 files changed

+1888
-1095
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

117 files changed

+1888
-1095
lines changed

.eslintrc.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,12 @@ module.exports = {
204204
match: false,
205205
},
206206
},
207+
{
208+
/* Ignore properties that require quotes */
209+
selector: "objectLiteralProperty",
210+
modifiers: ["requiresQuotes"],
211+
format: null,
212+
},
207213
],
208214
},
209215
},

.github/scripts/create_benchmark_check.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ module.exports = ({ github, context, core }) => {
1616

1717
const summary =
1818
`[Open visualizer](https://typescripttolua.github.io/benchviz?d=${compressed.toString("base64")})\n` +
19-
`### Lua5.3\n${benchmarkInfoLua.comparison.summary}\n### LuaJIT\n${benchmarkInfoJIT.comparison.summary}`;
19+
`### Lua5.3
20+
${benchmarkInfoLua.comparison.memory.summary}
21+
${benchmarkInfoLua.comparison.runtime.summary}
22+
---
23+
### LuaJIT
24+
${benchmarkInfoJIT.comparison.memory.summary}
25+
${benchmarkInfoJIT.comparison.runtime.summary}`;
2026

2127
return summary;
2228
};

CHANGELOG.md

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

3+
## 1.5.0
4+
5+
- Added support for `Array.from` and `Array.of`
6+
- Added support for `beforeEmit` hook to plugins that runs after tstl is totally done, but before emitting the result.
7+
- For more info about plugin hooks, see: https://typescripttolua.github.io/docs/api/plugins
8+
- Added support for import expressions (`import("./module").then(m => m.foo());`)
9+
- Added tsconfig setting `lua51AllowTryCatchInAsyncAwait` to disable restrictions on try/catch in combination with async/await in 5.1 (default: false)
10+
- Added tsconfig setting `noImplicitGlobalVariables` to disable tstl making variables global in non-module files.
11+
- Various lualib optimizations
12+
- JSDoc comments from input TS are now also part of output Lua as LDoc comments.
13+
- Can be disabled with `removeComments` tsconfig setting.
14+
- Rewrote how try/catch works in async functions, fixing many bugs.
15+
- Fixed a bug where methods with non-null expressions (i.e. `obj.method!()`) would not pass the correct self parameter, causing runtime errors.
16+
- Fixed a bug where symlinked node_modules (for example when using `npm link`) were not recognized as external dependencies by module resolution.
17+
- Fixed a bug with sourcemap traceback leading to invalid lua
18+
- Improved sourcemap traceback interaction with `loadstring`
19+
320
## 1.4.0
421

522
- Upgraded to TypeScript 4.6
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default function arrayConcat(): number[] {
2+
const arr1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
3+
const arr2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
4+
const n = 50000;
5+
for (let i = 0; i < n; i++) {
6+
arr1.concat(arr2);
7+
}
8+
return arr1;
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default function arrayConcat(): number[] {
2+
const arr1 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
3+
const arr2 = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0];
4+
const n = 50000;
5+
for (let i = 0; i < n; i++) {
6+
arr1.concat(...arr2);
7+
}
8+
return arr1;
9+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function arrayEvery() {
2+
const n = 200000;
3+
const array = [1, 2, 3, 4, 5, 6, 7, 8, 7, 10];
4+
for (let i = 0; i < n; i++) {
5+
array.every((item, index) => item > index);
6+
}
7+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function arrayFilter() {
2+
const n = 100000;
3+
const array = [1, 2, 3, 4, 3, 6, 7, 8, 7, 10];
4+
for (let i = 0; i < n; i++) {
5+
array.filter((item, index) => item > index);
6+
}
7+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default function arrayFind() {
2+
const n = 50000;
3+
const array = [1, 2, 3, 4, 3, 6, 7, 8, 9, 10];
4+
for (let i = 0; i < n; i++) {
5+
for (let j = 0; j < 10; j++) {
6+
array.find(value => value === j);
7+
}
8+
}
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
export default function arrayFindIndex() {
2+
const n = 50000;
3+
const array = [1, 2, 3, 4, 3, 6, 7, 8, 9, 10];
4+
for (let i = 0; i < n; i++) {
5+
for (let j = 0; j < 10; j++) {
6+
array.findIndex(value => value === j);
7+
}
8+
}
9+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
export default function arrayFlat() {
2+
const n = 50000;
3+
const array = [1, 2, [3, [4, 5], 6], 7, [8, 9], 10];
4+
for (let i = 0; i < n; i++) {
5+
array.flat(2);
6+
}
7+
}

0 commit comments

Comments
 (0)