Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pass default onwarn and onerror handlers to user's callbacks #883

Merged
merged 1 commit into from
Oct 17, 2017

Conversation

Conduitry
Copy link
Member

Part of #824. This is a bit hacky but it seemed to be the most localized change that addresses this. Basically I'm replacing options.onwarn and options.onerror with versions that take one argument (the warning/error) and call the user's original callback with two arguments (the warning/error and the default handlers). The reason for this was so that the several places where options.onwarn and options.onerror are called can all remain the same. This can be changed if that seems a bit too hacky.

@Conduitry Conduitry force-pushed the default-onwarn-onerror branch from 40de1f1 to 0567d08 Compare October 4, 2017 18:21
@Rich-Harris Rich-Harris merged commit ba3641f into master Oct 17, 2017
@Rich-Harris Rich-Harris deleted the default-onwarn-onerror branch October 17, 2017 20:42
@Rich-Harris
Copy link
Member

I think that's exactly the right approach, and it'll become particularly useful once warnings are objects with codes etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants