Skip to content

Conversation

@aheejin
Copy link
Member

@aheejin aheejin commented Jan 22, 2026

We used 'names' field to encode the enclosing function name of a given offset, so that we can provide the correct source location + function info that can be used in displaying stack traces.

I wasn't aware JS uses it for a very different purpose. JS uses it to display original variable/function names for minified names. In JS an 'offset' is a location in the minified JS code, and if that location happens to point to a minified variable name a whose original name was apple, its mapping contains apple.

So while we can use this field to support emsymbolizer, the browser devtools is unlikely to ever implement the support for our 'names' field for stack traces, which is basically unrelated from what JS does.

So this removes the support for the 'names' field. But it doesn't actually remove the implementation; it just puts it behind a fake flag that is set to False for now. The reason is, we want to provide this function info anyway for better stack traces support, and "Scopes" proposal for source maps, which was recently added, seems designed for this purpose. And I think we can reuse much of our current implementation (extract_func_ranges) to generate that format.

Fixes #26100.

We used 'names' field to encode the enclosing function name of a given
offset, so that we can provide the correct source location + function
info that can be used in displaying stack traces.

I wasn't aware JS uses it for a very different purpose. JS uses it to
display original variable/function names for minified names. In JS an
'offset' is a location in the minified JS code, and if that location
happens to point to a minified variable name `a` whose original name was
`apple`, its mapping contains `apple`.

So while we can use this field to support emsymbolizer, the browser
devtools is unlikely to ever implement the support for our 'names' field
for stack traces, which is basically unrelated from what JS does.

So this removes the support for the 'names' field. But it doesn't
actually remove the implementation; it just puts it behind a fake flag
that is set to `False` for now. The reason is, we want to provide this
function info anyway for better stack traces support, and "Scopes"
proposal for source maps, which was recently added, seems designed for
this purpose. And I think we can reuse much of our current
implementation (`extract_func_ranges`) to generate that format.
Comment on lines -9675 to -9677
# The addresses, function names, and source locations are the same across
# the builds because they are relative offsets from the code section, so we
# don't need to recompute them
Copy link
Member Author

Choose a reason for hiding this comment

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

Unrelated, but this comment seems unnecessary anyway

@aheejin aheejin merged commit 9016235 into emscripten-core:main Jan 22, 2026
36 checks passed
@aheejin aheejin deleted the no_names_field branch January 22, 2026 20:42
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.

Huge source map since 4.0.22

4 participants