fix(service-worker): fix the chrome debugger syntax highlighter (#38332)

The Chrome debugger is not able to render the syntax properly when the
code contains backticks. This is a known issue in Chrome and they have an
open [issue](https://bugs.chromium.org/p/chromium/issues/detail?id=659515) for that.
This commit adds the work-around to use double backslash with one
backtick ``\\` `` at the end of the line.

This can be reproduced by running the following command:

`yarn bazel test //packages/forms/test --config=debug`

When opening the chrome debugger tools, you should see the correct
code highlighting syntax.

PR Close #38332
This commit is contained in:
Sonu Kapoor 2020-08-03 12:32:14 -04:00 committed by Andrew Kushnir
parent 7525f3afc1
commit df7f3b04b5
1 changed files with 5 additions and 1 deletions

View File

@ -720,7 +720,11 @@ export class Driver implements Debuggable, UpdateSource {
private async deleteAllCaches(): Promise<void> {
await (await this.scope.caches.keys())
.filter(key => key.startsWith(`${this.adapter.cacheNamePrefix}:`))
// The Chrome debugger is not able to render the syntax properly when the
// code contains backticks. This is a known issue in Chrome and they have an
// open [issue](https://bugs.chromium.org/p/chromium/issues/detail?id=659515) for that.
// As a work-around for the time being, we can use \\ ` at the end of the line.
.filter(key => key.startsWith(`${this.adapter.cacheNamePrefix}:`)) // `
.reduce(async (previous, key) => {
await Promise.all([
previous,