diff options
author | Alon Zakai <alonzakai@gmail.com> | 2013-06-26 10:53:17 -0700 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2013-06-26 10:53:17 -0700 |
commit | 501022cbaa9e63cab9cc218ee0239256945a3061 (patch) | |
tree | fbad1d122eff2e22707552bff81b35fe2df4a621 /tools/source-maps/sourcemap2json.js | |
parent | 493d0dcf303d66726be5bb08c187f8183ee96a65 (diff) | |
parent | 5383aa8bf93e5c9fed3f67853b2675ab2be10493 (diff) |
Merge branch 'source-maps' of github.com:int3/emscripten into int3-source-maps
Conflicts:
tools/js-optimizer.js
Diffstat (limited to 'tools/source-maps/sourcemap2json.js')
-rw-r--r-- | tools/source-maps/sourcemap2json.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/source-maps/sourcemap2json.js b/tools/source-maps/sourcemap2json.js new file mode 100644 index 00000000..5dd162b2 --- /dev/null +++ b/tools/source-maps/sourcemap2json.js @@ -0,0 +1,15 @@ +/* + * Quick utility script for the Python test script to call. Could be replaced if + * a good Python source map library is found. + */ +var SourceMapConsumer = require('source-map').SourceMapConsumer; +var fs = require('fs'); + +var consumer = new SourceMapConsumer(fs.readFileSync(process.argv[2], 'utf-8')); +var mappings = []; + +consumer.eachMapping(function(mapping) { + mappings.push(mapping); +}); + +console.log(JSON.stringify(mappings)); |