Bug 1905653 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

Steps to reproduce:
  1. Run Nightly 129.0a1 (2024-06-30) (64-bit) with clean profile on macOS
  2. Open the attached file
  3. Open DevTools Debugger and select the HTML file
  4. Click prettify button

Actual result:

The JS code is prettified like the following, where backslashes inside the template literal get lost and results in an invalid code

```js
(function () {
  return `foo `bar` baz \1`;
}) ();
```

Expected result:

The JS code is prettified like the following:

```js
(function () {
  return `foo \`bar\` baz \\1`;
}) ();
```

This comes from the template literal not being handled by [PrettyFast.#writeToken](https://searchfox.org/mozilla-central/rev/e74b86533c2499eb6393071aeedcfb080d84e4da/devtools/client/debugger/src/workers/pretty-print/pretty-fast.js#316-317)
Steps to reproduce:
  1. Run Nightly 129.0a1 (2024-06-30) (64-bit) with clean profile on macOS
  2. Open the attached file
  3. Open DevTools Debugger and select the HTML file
  4. Click prettify button

Actual result:

The JS code is prettified like the following, where backslashes inside the template literal get lost and results in an invalid code

(the attached file contains unnecessary RegExp literal. please ignore it)

```js
(function () {
  return `foo `bar` baz \1`;
}) ();
```

Expected result:

The JS code is prettified like the following:

```js
(function () {
  return `foo \`bar\` baz \\1`;
}) ();
```

This comes from the template literal not being handled by [PrettyFast.#writeToken](https://searchfox.org/mozilla-central/rev/e74b86533c2499eb6393071aeedcfb080d84e4da/devtools/client/debugger/src/workers/pretty-print/pretty-fast.js#316-317)

Back to Bug 1905653 Comment 0