Skip to content

[docs] Remove incorrect claim that EM_ASM cannot use double quotes - #28478

Open
juj wants to merge 1 commit into
emscripten-core:mainfrom
juj:docs_em_asm_quotes
Open

juj wants to merge 1 commit into
emscripten-core:mainfrom
juj:docs_em_asm_quotes

Conversation

@juj

@juj juj commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

EM_ASM code can use double-quoted JavaScript strings; test/core/test_em_asm_2.cpp exercises both single and double quotes.

EM_ASM code can use double-quoted JavaScript strings; test/core/test_em_asm_2.cpp
exercises both single and double quotes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
a JavaScript console while running the offending code.
- JavaScript string literals inside :c:macro:`EM_ASM` code may use either
single quotes (``'``) or double quotes (``"``). See
`test/core/test_em_asm_2.cpp`_ for examples of both forms.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Or no quotes at all right? Maybe we should just drop this block completely?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Oops, I misread that context.

Still, since both are allowed why even bother mentioning this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I suppose it's unconventional in C/C++ to use 'string' for more than a single character, so it's valuable to mention it. The See ... for examples mention also seems useful.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'm not sure why its useful. if there was an issue with one form or another, that makes sense to mention. If everything just works then why mention this ? Should we also mention the === works, even though it doesn't in C++?

This branch has not been deployed

No deployments
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