[Console] Ensure `AggregateError`s are formatted correctly
The Promise.any proposal [1] [2] introduced a new error type into the
ECMAScript Standard, called `AggregateError`. This patch adds it to
DevTools’s hardcoded list of built-in error types so that it’s complete
again.
[1]: https://github.com/tc39/proposal-promise-any
[2]: https://v8.dev/features/promise-combinators#promise.any
Bug: v8:9808
Change-Id: I190e013a480a2eb83e4873f6ed026491e91d0362
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2767262
Reviewed-by: Changhao Han <[email protected]>
Commit-Queue: Changhao Han <[email protected]>
Auto-Submit: Mathias Bynens <[email protected]>
diff --git a/front_end/console/ConsoleViewMessage.ts b/front_end/console/ConsoleViewMessage.ts
index 37be198..be3e937 100644
--- a/front_end/console/ConsoleViewMessage.ts
+++ b/front_end/console/ConsoleViewMessage.ts
@@ -1428,8 +1428,16 @@
const runtimeModel = this._message.runtimeModel();
// TODO: Consider removing these in favor of a simpler regex.
- const errorPrefixes =
- ['EvalError', 'ReferenceError', 'SyntaxError', 'TypeError', 'RangeError', 'Error', 'URIError'];
+ const errorPrefixes = [
+ 'AggregateError',
+ 'Error',
+ 'EvalError',
+ 'RangeError',
+ 'ReferenceError',
+ 'SyntaxError',
+ 'TypeError',
+ 'URIError',
+ ];
if (!runtimeModel || !errorPrefixes.some(startsWith) && !/^[\w.]+Error\b/.test(string)) {
return null;
}