Skip to content

[embind] Stricter function argument name checking #23524

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

Merged

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jan 29, 2025

Distinguish between unknown argument list and the empty argument list when parsing function names.

Also use early return to make the code a little more compact.

Distinguish between unknown argument list and the empty argument list
when parsing function names.

Also use early return to make the code a little more compact.
@sbc100 sbc100 requested a review from brendandahl January 29, 2025 00:26
throw new Error('Argument names should match number of parameters.');
}

const args = [];
for (let i = argStart, x = 0; i < argTypes.length; i++) {
if (x < argsName.length) {
if (argsName) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We know that argsName is the correct length thanks to the Error above, right?

@sbc100 sbc100 merged commit 7591f1c into emscripten-core:main Jan 29, 2025
29 checks passed
@sbc100 sbc100 deleted the embind_function_argument_checking branch January 29, 2025 18:20
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