Files
sdk/pkg/js_ast
Stephen Adams cb16f98c0a [js_ast] Fix js_ast printer bugs
* Parenthesize calls within `new`-expression targets to prevent the call
  arguments being associated with the `new`-expression.

* Negation of exponentiation and negation as the left operand of
  exponentiation are syntax errors, so parenthesize the exponentiation
  or left operand.
  "-2 ** n" --> "(-2) ** n" or "-(2 ** n)"

* "e in e" needs to be parenthesized in more places in a for-statement
  to avoid printing a for-in statement. The missing place was the
  right operand of a binary operator.

  "for (i = (0 in o) || 1 in o"
  -->
  "for (i = (0 in o) || (1 in o)"

Bug: #54534
Bug: b/313833546
Bug: b/314023208
Bug: b/314041897
Change-Id: I12fcd75ac5546a425b21cd68a9bda3786ceb243d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/347423
Commit-Queue: Stephen Adams <sra@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2024-01-20 02:06:59 +00:00
..
2024-01-20 02:06:59 +00:00
2024-01-20 02:06:59 +00:00

js_ast

A library for creating JavaScript ASTs from templates.