Transpile property/method accesses that would be invalid Lua into bracket syntax
See original GitHub issueSolve the promise:andThen and Symbol.for macros in a more generic way, instead changing reserved Lua keyword accesses into bracket literal syntax.
Symbol["for"]
promise["then"](promise, ...) <-- need to do this special behavior for method syntax
Additionally when generating Lua from classes/otherwise, ensure that we do something like this:
t["then"] = function(self)
end
Issue Analytics
- State:
- Created 5 years ago
- Comments:18 (13 by maintainers)
Top Results From Across the Web
Lua 5.3 Reference Manual
A metatable controls how an object behaves in arithmetic operations, bitwise operations, order comparisons, concatenation, length operation, ...
Read more >Are curly brackets used in Lua? - Stack Overflow
Another place that curly braces appear is really the same semantic meaning, but it is concealed (for a new user of Lua) behind...
Read more >DataS/week1-MultilabelClassification.ipynb at master - GitHub
In this assignment you will learn how to predict tags for posts from StackOverflow. To solve this task you will use multilabel classification...
Read more >TS-runtime: Runtime Type Checks for TypeScript - Morioh
If runtime checks have to be inserted into an arrow function without a ... Only as number syntax for type assertions (no angle-bracket...
Read more >series' objects are mutable, thus they cannot be hashed
NSArray, NSSet, NSOrderedSet, and NSDictionary Foundation's collection classes are the basic building blocks of every Mac/iOS application. In this article ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

For Roblox-ts “built-in” names, I think all. For user created methods/variables/etc, just the keyword collisions. This could be more elegantly balanced if we carefully implemented Promise and perhaps the Run-time lib in TS.
Sure, we have precedent of doing something similar with generated variables elsewhere in the compiler (like
_0)But maybe allowing this is a bad idea to begin with: Classes created with TS that use reserved Lua keywords would lose the ability to inter-op with Lua effectively. But also, function calls can be expressions, so that could dramatically increase the complexity of compiled code.
For example,
foo(returnsAPromise().then(() => {}))