PythonMonkey icon indicating copy to clipboard operation
PythonMonkey copied to clipboard

Need external source map support

Open wesgarland opened this issue 2 years ago • 2 comments

Describe your feature request here.

Evaluating web pack bundles like dcp-client makes for horrifyingly bad stack traces if we don't have external source map support.

This can be avoided in dcp-client by building a debug bundle which uses internal source maps, but that's not the common case with code found in the wild.

I believe I added an options argument to pm.eval. I suggest adding an option which is the path to the sourcemap file.

Code example

No response

wesgarland avatar Jan 31 '24 18:01 wesgarland

I see CompileOptions& setSourceMapURL(const char16_t* s) which looks promising

philippedistributive avatar Feb 13 '24 22:02 philippedistributive

This might not be possible in spidermonkey

External source map support seems limited to passing a URL through from JS::Compile to the script object, where in firefox it is extracted JS debugger, and parsed in userland (I think)

A quick experiment,

   options.setSourceMapURL(u"file://./dcp-client-bundle.js.map");

also doesn't seem to do anything, I even looked with strace and tried a few variations.

We may have to punt on this one.

wesgarland avatar Mar 10 '24 19:03 wesgarland