Skip to content

Add source map support

Gary Li requested to merge li-gary/gjs:source-maps into master

Add source map support using Mozilla's source map library. Version 0.6.1 of this library is used to simplify our internal logic since it is the last version without requiring WebAssembly and the SourceMapConsumer constructor being a promise.

Following 6.2.2.1 of the source map standard, the source map URL is extracted without parsing using the reference algorithm.

A source map registry slot is added to global objects which is a map that contains SourceMapConsumers for each module file. On module resolve, async resolve or load, an entry in the map will be populated with the consumer. The consumer is then used to translate generated positions to original source positions.

Non-module files are also supported by explicitly invoking the populate logic.

`gjs_log_exception_full` is covered using the SavedFrame API. image
Debugger commands are covered with the Debugger.Frame API. image image

Fixes #474

Edited by Gary Li

Merge request reports