Skip to content

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

Merged
Rich-Harris merged 1 commit intomasterfrom
default-onwarn-onerror
Oct 17, 2017
Merged

pass default onwarn and onerror handlers to user's callbacks#883
Rich-Harris merged 1 commit intomasterfrom
default-onwarn-onerror

Conversation

@Conduitry
Copy link
Copy Markdown
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
Copy Markdown
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