Skip to content

Conversation

@aheejin
Copy link
Member

@aheejin aheejin commented Oct 27, 2025

This makes better distinction of module names and function lists. Suggested by by @sbc100 (emscripten-core/emscripten#25577 (comment)).

Currently this supports both module names with a : and without it for backwards compatibility and also to pass the CI.

Suggested by by @sbc100
(emscripten-core/emscripten#25577 (comment)).

Currently this supports both module names with a `:` and without it for
backwards compatibility and also to pass the CI.
@aheejin aheejin requested review from sbc100 and tlively October 27, 2025 14:47
aheejin added a commit to aheejin/emscripten that referenced this pull request Oct 27, 2025
This makes better distinction of module names and function lists.
Suggested by by @sbc100
(emscripten-core#25577 (comment)).

This has to land after
WebAssembly/binaryen#8003.

IString substr(size_t pos, size_t len = std::string_view::npos) const {
return IString(str.substr(pos, len));
}
Copy link
Member

Choose a reason for hiding this comment

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

Has binararyen really gone this long without a substr() or endswith() operations on strings?

Copy link
Member Author

Choose a reason for hiding this comment

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

Apparently 🤷🏻

Name name = WasmBinaryReader::escape(line);
if (newSection) {
if (name.endsWith(":")) {
name = name.substr(0, name.size() - 1);
Copy link
Member

Choose a reason for hiding this comment

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

You could be clever and allow (0, -1) here like in high level languages?

Copy link
Member Author

Choose a reason for hiding this comment

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

In basic_string_view::substr, the second argument is a count, the number of characters, so I think making the meaning of IString::substr different will be confusing. If we want that behavior we can add a separate function like slice(size_t start, size_end) or something. But we only have a single use here now, so I'm not sure if that's necessary at this point?

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