Lexical declarations in `case` and `default` clauses are a footgun,
since they are visible in the entire switch block, but they only
get initialized upon assignment, which only happens if the relevant
`case` is actually reached.
To ensure that such lexical declarations only apply to the current
`case` (which is usually the intention), `case` clauses containing
them should be wrapped in curly braces to create an explicit block.
More information:
https://eslint.org/docs/rules/no-case-declarations
Change-Id: I63d9341fcd76d4b9ce8281bd0e6573b886577f08
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2119685
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Mathias Bynens <mathias@chromium.org>
This CL introduces support for parsing and pulling translations out of
`*.ts` files.
It introduces code to parse a TypeScript AST to look for `ls` calls and
pass them back into the existing GRDP tooling.
As a purposeful limitation, it _only looks for `ls` calls_.
Change-Id: I3f91793165e11f0382d6266f4e2c2443701b299a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2095295
Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
Reviewed-by: Paul Lewis <aerotwist@chromium.org>
As part of the ESM migration, certain function needs to be renamed over
to a different namespace, e.g. Common.UIString becomes
Common.UIString.UIString. As such the script that looks for instances of
Common.UIString for localization fails to identify instances of the
updated calls to Common.UIString.UIString. This CL updates
localization_utils so that it is aware of the updated namespaces, but
treats them in the same way as their legacy counterparts.
Bug: 1006759
Change-Id: I0a7da9109ee969da4caac3283c4ff26f4589f68a
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/1985674
Reviewed-by: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Paul Lewis <aerotwist@chromium.org>