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

Disallow exports that are not valid C/C++ identifiers #23563

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Jan 31, 2025

I use std.isdentifier() here from python since it has the same rules for valid identifiers are C/C++.

We could try instead to allow this but I'm not sure it worth it given that our inputs are almost exclusively compiled from C/C++/rust.

See #23560

@dschuff
Copy link
Member

dschuff commented Jan 31, 2025

as I mentioned in #23560 it's actually JS identifier rules that matter here, not C; are they different?

@sbc100
Copy link
Collaborator Author

sbc100 commented Jan 31, 2025

as I mentioned in #23560 it's actually JS identifier rules that matter here, not C; are they different?

JS identifier rules are a bit more relaxed. You can do $foo for example. I think we want to stick to the more strict C/C++ rules. I don't see any reason to allow anything else at this point.

@sbc100
Copy link
Collaborator Author

sbc100 commented Jan 31, 2025

as I mentioned in #23560 it's actually JS identifier rules that matter here, not C; are they different?

JS identifier rules are a bit more relaxed. You can do $foo for example. I think we want to stick to the more strict C/C++ rules. I don't see any reason to allow anything else at this point.

We can always relax things later if had the need to.

I use `std.isdentifier()` here from python since it has the same rules
for valid identifiers are C/C++.

We could try instead to allow this but I'm not sure it worth it given
that our inputs are almost exclusively compiled from C/C++/rust.

See emscripten-core#23560
@sbc100 sbc100 enabled auto-merge (squash) February 1, 2025 00:13
@sbc100
Copy link
Collaborator Author

sbc100 commented Feb 1, 2025

I propose that we land this and then consider expanding later.

@sbc100
Copy link
Collaborator Author

sbc100 commented Feb 3, 2025

OK to land this?

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