Skip to content

fix: return empty string for missing 'type' field in emitWebIdl function #2027

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

Closed
wants to merge 1 commit into from

Conversation

Bashamega
Copy link
Contributor

related to #1993

Modified the function to exit silently instead of throwing an error.

Copy link
Contributor

Thanks for the PR!

This section of the codebase is owned by @saschanaz - if they write a comment saying "LGTM" then it will be merged.

@Bashamega
Copy link
Contributor Author

Hello @saschanaz
Do you have time to review this?
Thank you

@saschanaz
Copy link
Contributor

I don't think this is what we want, any broken object without type would then emit broken TypeScript without type. As I commented there it would be nicer to have a conditional merger function, that merges only when the object exists. (merge() merges every field which makes sense for addedTypes, not much for this case. Perhaps add a flag in merge() somehow?)

@Bashamega
Copy link
Contributor Author

I don't think this is what we want, any broken object without type would then emit broken TypeScript without type. As I commented there it would be nicer to have a conditional merger function, that merges only when the object exists. (merge() merges every field which makes sense for addedTypes, not much for this case. Perhaps add a flag in merge() somehow?)

For example, add a flag to ignore errors?

@saschanaz
Copy link
Contributor

To do a conditional merge. Errors should not be ignored.

@saschanaz
Copy link
Contributor

Something like this. (A modified version of what we already have in src/build/helpers.ts.

@Bashamega Bashamega closed this May 28, 2025
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