mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-11-03 11:49:12 +08:00
This is a reland of crrev.com/c/2959898 which caused the roll to fail. This has been fixed by updating expectations in `front_end/Tests.js` Original change's description: > Improve Console display of strings > > We recently changed how we display the output to ensure that we always > display valid JavaScript literals. Unfortunately, the current solution > can be confusing to users, who might feel that the amount of escaping is > excessive and makes the output unreadable. > > This change introduces `formatAsJSLiteral` that given a string escapes > appropriate special characters and wraps the string in either single > quotes, double quotes, or back ticks depending on the string content. > The function furthermore escapes script tags to ensure that the result > can be safely copied to HTML. > > Both regular Console output and preview have been updated to use this > formatter instead of JSON.stringify for displaying strings. > > This change adds unit tests for the new formatter and rebaselines all > e2e tests that depend on Console outputs. > > Doc: https://goo.gle/devtools-strings > Bug: 1208389 > Change-Id: Iebfe39c2e40c21aa5a813a1ebd26a5109fa59ab6 > Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2959898 > Commit-Queue: Johan Bay <jobay@chromium.org> > Reviewed-by: Mathias Bynens <mathias@chromium.org> > Reviewed-by: Changhao Han <changhaohan@chromium.org> Bug: 1208389 Change-Id: I6f443e65364d9707d02aeaab0227bd691300b417 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2978351 Reviewed-by: Alex Rudenko <alexrudenko@chromium.org> Reviewed-by: Mathias Bynens <mathias@chromium.org> Commit-Queue: Johan Bay <jobay@chromium.org>