33This is a library to generate and consume the source map format
44[ described here] [ format ] .
55
6- This library is written in the Asynchronous Module Definition format, and works
7- in the following environments:
6+ This library is compatible with the following environments:
87
9- * Modern Browsers supporting ECMAScript 5 (either after the build, or with an
10- AMD loader such as RequireJS)
8+ * Node.js versions 0.8.X and higher
119
12- * Inside Firefox (as a JSM file, after the build)
10+ * On the web, with browsers supporting ECMAScript 5 ( after the build)
1311
14- * With NodeJS versions 0.8.X and higher
12+ * Inside Firefox (after the build)
1513
1614## Node
1715
@@ -23,19 +21,22 @@ Install Node and then run
2321
2422 $ git clone https://fitzgen@github.com/mozilla/source-map.git
2523 $ cd source-map
26- $ npm link .
2724
2825Next, run
2926
30- $ node Makefile.dryice.js
27+ $ npm run build
3128
32- This should spew a bunch of stuff to stdout, and create the following files:
29+ This will create the following files:
3330
34- * ` dist/source-map.js ` - The unminified browser version .
31+ * ` dist/source-map.js ` - The plain browser build .
3532
36- * ` dist/source-map.min.js ` - The minified browser version .
33+ * ` dist/source-map.min.js ` - The minified browser build .
3734
38- * ` dist/SourceMap.jsm ` - The JavaScript Module for inclusion in Firefox source.
35+ * ` dist/source-map.min.js.map ` - The source map for the minified browser build.
36+
37+ * ` dist/source-map.debug.js ` - The debug browser build.
38+
39+ * ` dist/source-map.debug.js.map ` - The source map for the debug browser build.
3940
4041## Examples
4142
@@ -152,8 +153,7 @@ var sourceMap = require('source-map');
152153var sourceMap = window .sourceMap ;
153154
154155// Inside Firefox
155- let sourceMap = {};
156- Components .utils .import (' resource:///modules/devtools/SourceMap.jsm' , sourceMap);
156+ const sourceMap = require (" devtools/toolkit/sourcemap/source-map.js" );
157157```
158158
159159### SourceMapConsumer
@@ -473,20 +473,19 @@ The arguments are the same as those to `new SourceMapGenerator`.
473473
474474[ ![ Build Status] ( https://travis-ci.org/mozilla/source-map.png?branch=master )] ( https://travis-ci.org/mozilla/source-map )
475475
476- Install NodeJS version 0.8.0 or greater, then run ` node test/run-tests.js ` .
476+ Install NodeJS version 0.8.0 or greater, then run ` npm test` .
477477
478- To add new tests, create a new file named ` test/test-<your new test name>.js `
479- and export your test functions with names that start with "test", for example
478+ To add new tests, create a new file named
479+ ` test/source-map/test-your-new-test-name.js ` and export your test functions with
480+ names that start with "test", for example
480481
481482``` js
482- exports [" test doing the foo bar" ] = function (assert , util ) {
483+ exports [" test doing the foo bar" ] = function (assert ) {
483484 ...
484485};
485486```
486487
487- The new test will be located automatically when you run the suite.
488-
489- The ` util ` argument is the test utility module located at ` test/source-map/util ` .
488+ The new tests will be located automatically when you run the suite.
490489
491490The ` assert ` argument is a cut down version of node's assert module. You have
492491access to the following assertion functions:
@@ -502,8 +501,8 @@ access to the following assertion functions:
502501* ` throws `
503502
504503(The reason for the restricted set of test functions is because we need the
505- tests to run inside Firefox's test suite as well and so the assert module is
506- shimmed in that environment. See ` build/ assert-shim.js ` .)
504+ tests to run inside Firefox's test suite as well and Firefox has a shimmed
505+ assert module .)
507506
508507[ format ] : https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit
509508[ feature ] : https://wiki.mozilla.org/DevTools/Features/SourceMap
0 commit comments