The empty catch block silently swallows all errors without any fallback behavior or logging. Consider adding a comment explaining what specific errors are expected (like accessing prototype on Proxy objects) and potentially log unexpected errors in development mode.
} catch (err) {
// If accessing prototype throws, it's not a constructor. This can happen with Proxy objects or in restricted environments.
// Only TypeError is expected here; log unexpected errors in development mode.
if (process.env.NODE_ENV !== 'production') {
if (!(err instanceof TypeError)) {
console.error('Unexpected error in matchError when accessing prototype:', err);
}
}
Originally posted by @Copilot in #1760 (comment)