emscripten-core / emscripten

Emscripten: An LLVM-to-WebAssembly Compiler
Other
25.74k stars 3.3k forks source link

Unify two different runtime source map parsing methods #16731

Open sbc100 opened 2 years ago

sbc100 commented 2 years ago

We currently have two different ways to process source maps at runtime, both for the purpose of symbolicating stack traces:

  1. src/source_map_support.js, enabled via internal LOAD_SOURCE_MAP setting. Used by santizers to give useful stack traces.
  2. src/emscripten-source-map.min.js , used by emscripten_get_callstack and emscripten_log_js and _Unwind_Backtrace in library.js
sbc100 commented 2 years ago

I'm not sure why (1) was added when the santizer work was done but now that it is done is seems like should favor that one. For a couple of reasons:

  1. src/emscripten-source-map.min.js does not work under node.
  2. src/emscripten-source-map.min.js contains a minified version of code from npm making it obsure and hard to maintain/audit.

So I propose that we delete src/emscripten-source-map.min.js and use src/source_map_support.js everywhere.

kripken commented 2 years ago

Plan sounds good to me - I'm not sure either why we have two.