mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-30 09:17:09 +08:00
Currently, if an unsupported JS feature is used, localization presubmit checks will fail with the raw error message from esprima, the JS parsing library. This CL wraps a try-catch block around the parsing call and outputs a nice error message that specifies the file location and the reason. Before: Error: Line 9: Unexpected token = After: Error: DevTools localization parser failed: third_party\blink\renderer\devtools\front_end\security\SecurityPanel.js: Line 9: Unexpected token = This error is likely due to unsupported JavaScript features. Such features are not supported by eslint either and will cause presubmit to fail. Please update the code and use official JavaScript features. Bug: 941561 Change-Id: If945563f84224232155a7de7cf597c5395a0cbb9 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1729729 Reviewed-by: Yang Guo <yangguo@chromium.org> Commit-Queue: Mandy Chen <mandy.chen@microsoft.com> Cr-Original-Commit-Position: refs/heads/master@{#697675} Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src Cr-Mirrored-Commit: 2b4a1abab0661e491ab275768f8f174cf5686c46