You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While superfluous parens have no official semantics, they are actually used by browsers to perform laziness tricks:
varfoo=function(){ ... };// Parsed lazily by the browser.varbar=(function(){ ... });// Parsed eagerly by the browser.
It would be very useful to keep superfluous parens in such a case (or perhaps always). I don't know if that's what ratel does currently, so documenting the choice would be useful, too!
Perhaps it should be a parsing option?
The text was updated successfully, but these errors were encountered:
Superfluous parens are always dropped. I don't particularly see a reason to change it since the goal is to produce an AST, not a parse tree. In either case, we do need a proper book for all of this stuff.
Well, these superfluous parens turn out to have an observable (by timing) effect, so they are de facto part of the language. For instance, in Binary AST, we make the difference between EagerFunctionDeclaration and LazyFunctionDeclaration.
Would it be possible to somehow store the information somewhere?
While superfluous parens have no official semantics, they are actually used by browsers to perform laziness tricks:
It would be very useful to keep superfluous parens in such a case (or perhaps always). I don't know if that's what ratel does currently, so documenting the choice would be useful, too!
Perhaps it should be a parsing option?
The text was updated successfully, but these errors were encountered: