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

wasm-parser: skip rather than throw on unknown sections #1117

Merged
merged 2 commits into from
Jul 2, 2022

Conversation

bpowers
Copy link
Contributor

@bpowers bpowers commented Jun 25, 2022

One new section type is 0xd exception, which doesn't need any special processing, and the details aren't useful to e.g. Webpack. It seems most robust to just skip unknown sections by default rather than have to make a change + release to unbreak parsing for spec additions.

I also added an option errorOnUnknownSection to keep the old behavior, in case people want to match the old behavior.

I tested this by patching a local project that uses the new exception instructions (throw, try, etc) in a WebAssembly file that is processed by Webpack and it works well.

Finally I bumped the version for wasm-parser. If this looks good + mergable (happy to make changes, too!), @xtuc could you cut a release?

One new section type is 0xd `exception`, which doesn't need any
special processing, and the details aren't useful to e.g. Webpack.  It
seems most robust to just skip unknown sections by default rather than
have to make a change + release to unbreak parsing for spec additions.
Copy link
Owner

@xtuc xtuc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice thanks

@xtuc xtuc merged commit c8be65e into xtuc:master Jul 2, 2022
@xtuc
Copy link
Owner

xtuc commented Jul 2, 2022

@bpowers your change as been publish as @1.11.3

@bpowers
Copy link
Contributor Author

bpowers commented Jul 2, 2022

amazing, thanks @xtuc !

@xtuc
Copy link
Owner

xtuc commented Jul 2, 2022

@bpowers do you plan to update webassemblyjs in Webpack?

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