-
Notifications
You must be signed in to change notification settings - Fork 97
Closed
Description
Since ignore AST nodes isn't an option, ignoring functions becomes difficult:
/* c8 ignore next 11 */
function wrapRuntimeEvalErrorInBrowser(err) {
err = err || new Error();
const fallbackMessage = typeof err === 'string' ? err : 'unknown error';
return {
__failedInBrowser: true,
name: err.name || 'Error',
message: err.message || fallbackMessage,
stack: err.stack || (new Error()).stack,
};
}
Most changes to this function will require modifying the ignore comment.
With istanbul it's trivial:
/* istanbul ignore next */
function wrapRuntimeEvalErrorInBrowser(err) {
err = err || new Error();
const fallbackMessage = typeof err === 'string' ? err : 'unknown error';
return {
__failedInBrowser: true,
name: err.name || 'Error',
message: err.message || fallbackMessage,
stack: err.stack || (new Error()).stack,
};
}
But no AST. instead, what about a "start ignoring" & "stop ignoring" comment?
Metadata
Metadata
Assignees
Labels
No labels