Found a bug, looks like transpiled static methods no longer have a self parameter.
class Player {
static initialize() {
this.x = 0; // this = Player
}
}
Player.initialize();
console.log(Player.x);
When transpiled to Lua initialize turns into
function Player.initialize()
self.x = 0;
end
So that function won't work, self will always be nil.
Transpile and run this code with tsc and node and you'll get an output of 0.
tsc main.ts && node main.js
Found a bug, looks like transpiled static methods no longer have a
selfparameter.When transpiled to Lua
initializeturns intoSo that function won't work,
selfwill always benil.Transpile and run this code with
tscandnodeand you'll get an output of0.tsc main.ts && node main.js