Description
The names section is intended to be the simplest thing possible to provide a basic source-code callstack. Currently, the names in the names section show up in Error.stack
and devtools debugger callstacks. However, Error.stack
and the debugger's callstacks also show filename and line number and, for lack of a better option, these are set to the URL of the JS function that compiled the wasm and the bytecode offset of the function in the wasm module. I think there's be a pretty big win, at low impl cost, to extend the names section to additionally specify filename and line number for each function as well.
Since filenames are long and there are far fewer unique filenames than functions, I think the names section should start with a sequence of filenames and then each function could index into that array.
Of course we'd like to avoid feature creep given that there are already tentative plans for something much more general to support first-class source debugger, but I think this fits pretty squarely in the scope of the names section given that it shows up in even the most basic callstack machinery.