Closed alfredosalzillo closed 2 months ago
When targeting an older version, the same way that the transpiler would change the ?=
syntax it would also register the symbol globally. Also, it would waste a lot of memory by creating another function.
Symbols are how new features are being implemented and backported as well, like https://github.com/tc39/proposal-explicit-resource-management
Interesting proposal but I have some concerns about the backwards compatibility of the proposal.
Implemented using a new symbol doesn't mean it can be used within existing code? As I understand the operator can only be called or have an effect on the code using the new symbol.
Would it work implemented as follow:
Where goify is simply implemented for example as follow
Implemented like this for all the cases (object, function, promise, function returning a promise) will make the operator a sugar syntax compatible with existing code.