├── .gitignore ├── LICENSE ├── README.md ├── haxelib.json ├── src ├── SourceMap.hx └── sourcemap │ ├── Data.hx │ ├── Mapping.hx │ ├── SourceMapException.hx │ ├── SourcePos.hx │ └── Vlq.hx ├── test-js-min.hxml ├── test.hxml └── test ├── MappingTest.hx ├── Test.hx ├── VlqTest.hx ├── data ├── expected.json └── test.map └── js-minified-header.js /.gitignore: -------------------------------------------------------------------------------- 1 | bin/* 2 | *.zip 3 | .vscode 4 | .haxelib -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Alexander Kuzmenko 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Source maps 2 | 3 | Cross platform source map parser for Haxe programming language. 4 | 5 | ## Usage 6 | 7 | ```haxe 8 | import sourcemap.SourcePos; 9 | 10 | class Main { 11 | 12 | static public function main() { 13 | var data = "Contents of some .js.map file"; 14 | var map = new SourceMap(data); 15 | 16 | var pos : SourcePos = map.originalPositionFor(1, 3); 17 | trace(pos); 18 | /* 19 | Outputs: 20 | { 21 | generatedLine:1, 22 | generatedColumn:3, 23 | originalColumn:10, 24 | originalLine:3, 25 | source:"/path/to/Test.hx", 26 | name:"methodName" 27 | } 28 | */ 29 | 30 | map.eachMapping(function (pos:SourcePos) { 31 | trace(pos); 32 | }); 33 | } 34 | } 35 | ``` 36 | -------------------------------------------------------------------------------- /haxelib.json: -------------------------------------------------------------------------------- 1 | { 2 | "name" : "sourcemap", 3 | "url" : "https://github.com/RealyUniqueName/sourcemap", 4 | "license" : "MIT", 5 | "tags" : ["sourcemap", "source", "map", "mapping", "debug"], 6 | "description" : "Source maps parser", 7 | "version" : "1.1.0", 8 | "releasenote" : "Support advanced js minification", 9 | "classPath" : "src", 10 | "contributors" : ["RealyUniqueName"], 11 | "dependencies" : {} 12 | } -------------------------------------------------------------------------------- /src/SourceMap.hx: -------------------------------------------------------------------------------- 1 | import haxe.Json; 2 | import sourcemap.*; 3 | 4 | using sourcemap.Vlq; 5 | 6 | private typedef Mappings = Array>; 7 | 8 | class SourceMap { 9 | /** Specification version. The only supported version is 3. */ 10 | public var version (default,null) : Int = 3; 11 | /** File with the generated code that this source map is associated with. */ 12 | public var file (default,null) : Null; 13 | /** This value is prepended to the individual entries in the `sources` field. */ 14 | public var sourceRoot (default,null) : String = ''; 15 | /** A list of original source files. */ 16 | public var sources (default,null) : Array; 17 | /** A list of contents of files mentioned in `sources` if those files cannot be hosted. */ 18 | public var sourcesContent (default,null) : Array; 19 | /** A list of symbol names used in `mappings` */ 20 | public var names (default,null) : Array; 21 | 22 | /** Decoded mappings data */ 23 | var mappings : Array> = []; 24 | 25 | /** 26 | * Create a source map parser. 27 | * @param sourceMapData - Raw data from a source map file. This parser does not validate it. 28 | * So it's your responsibility to provide correct data. 29 | */ 30 | public function new (sourceMapData:String) { 31 | parse(sourceMapData); 32 | } 33 | 34 | /** 35 | * Get position in original source file. 36 | * Returns `null` if provided `line` and/or `column` don't exist in compiled file. 37 | * @param line - `1`-based line number in generated file. 38 | * @param column - zero-based column number in generated file. 39 | */ 40 | public function originalPositionFor (line:Int, column:Int = 0) : Null { 41 | if (line < 1 || line > mappings.length) return null; 42 | 43 | var pos : SourcePos = null; 44 | for (mapping in mappings[line - 1]) { 45 | if (mapping.generatedColumn <= column) { 46 | pos = mapping.getSourcePos(this, line); 47 | break; 48 | } 49 | } 50 | 51 | return pos; 52 | } 53 | 54 | /** 55 | * Invoke `callback` for each mapped position. 56 | */ 57 | public function eachMapping (callback:SourcePos->Void) { 58 | for (line in 0...mappings.length) { 59 | for (mapping in mappings[line]) { 60 | callback(mapping.getSourcePos(this, line + 1)); 61 | } 62 | } 63 | } 64 | 65 | /** 66 | * Parse raw source map data 67 | * @param json - Raw content of source map file 68 | */ 69 | function parse (json:String) { 70 | var data : Data = Json.parse(json); 71 | if (data == null) throw new SourceMapException("Failed to parse source map data."); 72 | 73 | version = data.version; 74 | file = data.file; 75 | sourceRoot = (data.sourceRoot == null ? '' : data.sourceRoot); 76 | sources = data.sources; 77 | sourcesContent = (data.sourcesContent == null ? [] : data.sourcesContent); 78 | names = data.names; 79 | 80 | var encoded = data.mappings.split(';'); 81 | //help some platforms to pre-alloc array 82 | mappings[encoded.length - 1] = null; 83 | 84 | var previousSource = 0; 85 | var previousLine = 0; 86 | var previousColumn = 0; 87 | var previousName = 0; 88 | 89 | for (l in 0...encoded.length) { 90 | mappings[l] = []; 91 | if (encoded[l].length == 0) continue; 92 | 93 | var previousGeneratedColumn = 0; 94 | 95 | var segments = encoded[l].split(','); 96 | mappings[l][segments.length - 1] = null; 97 | 98 | for (s in 0...segments.length) { 99 | var mapping = new Mapping(segments[s].decode()); 100 | mappings[l][s] = mapping; 101 | mapping.offsetGeneratedColumn(previousGeneratedColumn); 102 | if (mapping.hasSource()) { 103 | mapping.offsetSource(previousSource); 104 | mapping.offsetLine(previousLine); 105 | mapping.offsetColumn(previousColumn); 106 | if (mapping.hasName()) { 107 | mapping.offsetName(previousName); 108 | previousName = mapping.name; 109 | } 110 | previousLine = mapping.line; 111 | previousSource = mapping.source; 112 | previousColumn = mapping.column; 113 | } 114 | previousGeneratedColumn = mapping.generatedColumn; 115 | } 116 | } 117 | } 118 | } 119 | -------------------------------------------------------------------------------- /src/sourcemap/Data.hx: -------------------------------------------------------------------------------- 1 | package sourcemap; 2 | 3 | import haxe.DynamicAccess; 4 | 5 | /** 6 | * Structure of a raw source map data. 7 | */ 8 | abstract Data(DynamicAccess) to DynamicAccess { 9 | 10 | /** Specification version. The only supported version is 3. */ 11 | public var version(get,never) : Int; 12 | 13 | /** File with the generated code that this source map is associated with. */ 14 | public var file(get,never) : Null; 15 | 16 | /** This value is prepended to the individual entries in the `sources` field. */ 17 | public var sourceRoot(get,never) : Null; 18 | 19 | /** A list of original source files. */ 20 | public var sources(get,never) : Array; 21 | 22 | /** A list of contents of files mentioned in `sources` if those files cannot be hosted. */ 23 | public var sourcesContent(get,never) : Null>; 24 | 25 | /** A list of symbol names used in `mappings` */ 26 | public var names(get,never) : Array; 27 | 28 | /** Encoded mappings data. */ 29 | public var mappings(get,never) : String; 30 | 31 | 32 | inline function get_version() : Int 33 | return this.get('version'); 34 | 35 | inline function get_file() : Null 36 | return this.get('file'); 37 | 38 | inline function get_sourceRoot() : Null 39 | return this.get('sourceRoot'); 40 | 41 | inline function get_sources() : Array 42 | return this.get('sources'); 43 | 44 | inline function get_sourcesContent() : Null> 45 | return this.get('sourcesContent'); 46 | 47 | inline function get_names() : Array 48 | return this.get('names'); 49 | 50 | inline function get_mappings() : String 51 | return this.get('mappings'); 52 | } -------------------------------------------------------------------------------- /src/sourcemap/Mapping.hx: -------------------------------------------------------------------------------- 1 | package sourcemap; 2 | 3 | /** 4 | * Represents each group in source map `mappings` field. 5 | */ 6 | abstract Mapping(Array) { 7 | static inline var GENERATED_COLUMN = 0; 8 | static inline var SOURCE = 1; 9 | static inline var LINE = 2; 10 | static inline var COLUMN = 3; 11 | static inline var NAME = 4; 12 | 13 | /** Zero-based starting column of the line in the generated code */ 14 | public var generatedColumn (get,never) : Int; 15 | /** Zero-based index into the `sources` list of source map */ 16 | public var source (get,never) : Int; 17 | /** Zero-based starting line in the original source represented */ 18 | public var line (get,never) : Int; 19 | /** Zero-based starting column of the line in the source represented */ 20 | public var column (get,never) : Int; 21 | /** Zero-based index into the `names` list of source map */ 22 | public var name (get,never) : Int; 23 | 24 | public inline function new (data:Array) { 25 | this = data; 26 | } 27 | 28 | public inline function getSourcePos (map:SourceMap, generatedLine:Int) : SourcePos { 29 | var pos = new SourcePos(); 30 | pos.generatedLine = generatedLine; 31 | pos.generatedColumn = generatedColumn; 32 | if (hasSource()) { 33 | pos.originalLine = line + 1; 34 | pos.originalColumn = column; 35 | pos.source = map.sourceRoot + map.sources[source]; 36 | if (hasName()) { 37 | pos.name = map.names[name]; 38 | } 39 | } 40 | return pos; 41 | } 42 | 43 | public inline function hasSource () : Bool return this.length > SOURCE; 44 | public inline function hasLine () : Bool return this.length > LINE; 45 | public inline function hasColumn () : Bool return this.length > COLUMN; 46 | public inline function hasName () : Bool return this.length > NAME; 47 | 48 | public inline function offsetGeneratedColumn (offset:Int) this[GENERATED_COLUMN] += offset; 49 | public inline function offsetSource (offset:Int) this[SOURCE] += offset; 50 | public inline function offsetLine (offset:Int) this[LINE] += offset; 51 | public inline function offsetColumn (offset:Int) this[COLUMN] += offset; 52 | public inline function offsetName (offset:Int) this[NAME] += offset; 53 | 54 | inline function get_generatedColumn () return this[GENERATED_COLUMN]; 55 | inline function get_source () return this[SOURCE]; 56 | inline function get_line () return this[LINE]; 57 | inline function get_column () return this[COLUMN]; 58 | inline function get_name () return this[NAME]; 59 | } -------------------------------------------------------------------------------- /src/sourcemap/SourceMapException.hx: -------------------------------------------------------------------------------- 1 | package sourcemap; 2 | 3 | import haxe.Exception; 4 | 5 | /** 6 | * Exceptions from the "sourcemap" library. 7 | */ 8 | class SourceMapException extends Exception { 9 | 10 | } -------------------------------------------------------------------------------- /src/sourcemap/SourcePos.hx: -------------------------------------------------------------------------------- 1 | package sourcemap; 2 | 3 | import haxe.DynamicAccess; 4 | 5 | abstract SourcePos(DynamicAccess) to DynamicAccess { 6 | 7 | /** Original source file. */ 8 | public var source(get,set) : Null; 9 | 10 | /** "1"-based line in the original file. */ 11 | public var originalLine(get,set) : Null; 12 | 13 | /** Zero-based starting column of the line in the original file. */ 14 | public var originalColumn(get,set) : Null; 15 | 16 | /** Zero-based starting column of the line in the generated file. */ 17 | public var generatedColumn(get,set) : Int; 18 | 19 | /** "1"-based line in the generated file. */ 20 | public var generatedLine(get,set) : Int; 21 | 22 | /** Original symbol name. */ 23 | public var name(get,set) : Null; 24 | 25 | public function new() { 26 | this = {}; 27 | } 28 | 29 | inline function get_source() : Null 30 | return this.get('source'); 31 | 32 | inline function set_source(v:Null) : Null 33 | return this.set('source', v); 34 | 35 | inline function get_originalLine() : Null 36 | return this.get('originalLine'); 37 | 38 | inline function set_originalLine(v:Null) : Null 39 | return this.set('originalLine', v); 40 | 41 | inline function get_originalColumn() : Null 42 | return this.get('originalColumn'); 43 | 44 | inline function set_originalColumn(v:Null) : Null 45 | return this.set('originalColumn', v); 46 | 47 | inline function get_generatedColumn() : Int 48 | return this.get('generatedColumn'); 49 | 50 | inline function set_generatedColumn(v:Int) : Int 51 | return this.set('generatedColumn', v); 52 | 53 | inline function get_generatedLine() : Int 54 | return this.get('generatedLine'); 55 | 56 | inline function set_generatedLine(v:Int) : Int 57 | return this.set('generatedLine', v); 58 | 59 | inline function get_name() : Null 60 | return this.get('name'); 61 | 62 | inline function set_name(v:Null) : Null 63 | return this.set('name', v); 64 | } -------------------------------------------------------------------------------- /src/sourcemap/Vlq.hx: -------------------------------------------------------------------------------- 1 | package sourcemap; 2 | 3 | using StringTools; 4 | 5 | class Vlq { 6 | static inline var SHIFT = 5; 7 | static inline var MASK = (1 << SHIFT) - 1; 8 | 9 | /** 10 | * Get a number in range 0...64 (excluding) 11 | * @param charCode - A code of a valid base64 character. It's not verified, so be sure it's a valid character. 12 | * @return Int 13 | */ 14 | static inline function base64Decode (charCode:Int):Int { 15 | if ('a'.code <= charCode) return charCode - 'a'.code + 26; //26 is the position of `a` in base64 alphabet 16 | if ('A'.code <= charCode) return charCode - 'A'.code; 17 | if ('0'.code <= charCode) return charCode - '0'.code + 52; //52 is the position of `0` in base64 alphabet 18 | if (charCode == '+'.code) return 62; 19 | return 63; // `/` 20 | } 21 | 22 | static public inline function decode (vlq:String):Array { 23 | var data = []; 24 | var index = -1; 25 | var lastIndex = vlq.length - 1; 26 | while(index < lastIndex) { 27 | var value = 0; 28 | var shift = 0; 29 | var digit, masked; 30 | do { 31 | if(index >= lastIndex) { 32 | throw new SourceMapException('Failed to parse vlq: $vlq'); 33 | } 34 | digit = base64Decode(vlq.fastCodeAt(++index)); 35 | masked = digit & MASK; 36 | value += masked << shift; 37 | shift += SHIFT; 38 | } while(digit != masked); 39 | 40 | //the least significant bit in VLQ is used to store a sign 41 | data.push(value & 1 == 1 ? -(value >> 1) : value >> 1); 42 | } 43 | 44 | return data; 45 | } 46 | } -------------------------------------------------------------------------------- /test-js-min.hxml: -------------------------------------------------------------------------------- 1 | test.hxml 2 | 3 | -lib closure 4 | -D closure_advanced 5 | -D closure_overwrite 6 | -D closure_warning_level=QUIET 7 | --macro includeFile('test/js-minified-header.js') 8 | 9 | --js bin/test.js 10 | 11 | --cmd node bin/test.js -------------------------------------------------------------------------------- /test.hxml: -------------------------------------------------------------------------------- 1 | -cp src 2 | -cp test 3 | -lib utest 4 | -main Test 5 | -D analyzer-optimize 6 | -resource test/data/test.map@test.map 7 | -resource test/data/expected.json@expected.json 8 | 9 | # -D php7 10 | # -php bin/php 11 | # -neko bin/test.n 12 | -------------------------------------------------------------------------------- /test/MappingTest.hx: -------------------------------------------------------------------------------- 1 | package; 2 | 3 | import sourcemap.SourcePos; 4 | import utest.Test; 5 | import utest.Assert; 6 | import haxe.Resource; 7 | import haxe.Json; 8 | 9 | class MappingTest extends Test { 10 | public function testMapping () { 11 | var map = new SourceMap(Resource.getString('test.map')); 12 | 13 | var actual = []; 14 | map.eachMapping(actual.push); 15 | var expected:Array = Json.parse(Resource.getString('expected.json')); 16 | 17 | Assert.equals(expected.length, actual.length); 18 | for (i in 0...expected.length) { 19 | Assert.equals(expected[i].generatedColumn, actual[i].generatedColumn); 20 | Assert.equals(expected[i].generatedLine, actual[i].generatedLine); 21 | Assert.equals(expected[i].originalColumn, actual[i].originalColumn); 22 | Assert.equals(expected[i].originalLine, actual[i].originalLine); 23 | Assert.equals(expected[i].source, actual[i].source); 24 | Assert.equals(expected[i].name, actual[i].name); 25 | } 26 | } 27 | 28 | 29 | } -------------------------------------------------------------------------------- /test/Test.hx: -------------------------------------------------------------------------------- 1 | package; 2 | 3 | import utest.UTest; 4 | 5 | class Test { 6 | static public function main () { 7 | UTest.run([ 8 | new VlqTest(), 9 | new MappingTest() 10 | ]); 11 | } 12 | } -------------------------------------------------------------------------------- /test/VlqTest.hx: -------------------------------------------------------------------------------- 1 | package; 2 | 3 | import utest.Test; 4 | import utest.Assert; 5 | 6 | using sourcemap.Vlq; 7 | 8 | class VlqTest extends Test { 9 | 10 | public function testDecode () { 11 | Assert.same([0, 0, 5, 18], 'AAKkB'.decode()); 12 | Assert.same([0], 'A'.decode()); 13 | Assert.same([0, 0, 1, -1, 2], 'ABCDE'.decode()); 14 | } 15 | 16 | // public function testDecode_arbitraryLength () { 17 | // } 18 | } -------------------------------------------------------------------------------- /test/data/expected.json: -------------------------------------------------------------------------------- 1 | [{"source":"file:///home/example/Test.hx","generatedLine":23,"generatedColumn":0,"originalLine":6,"originalColumn":18,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":29,"generatedColumn":0,"originalLine":10,"originalColumn":24,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":31,"generatedColumn":0,"originalLine":11,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":31,"generatedColumn":0,"originalLine":11,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":31,"generatedColumn":0,"originalLine":11,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":31,"generatedColumn":12,"originalLine":11,"originalColumn":8,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":33,"generatedColumn":0,"originalLine":12,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":33,"generatedColumn":5,"originalLine":12,"originalColumn":10,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":33,"generatedColumn":5,"originalLine":12,"originalColumn":10,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":33,"generatedColumn":5,"originalLine":12,"originalColumn":10,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":33,"generatedColumn":17,"originalLine":12,"originalColumn":16,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":35,"generatedColumn":0,"originalLine":13,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":35,"generatedColumn":0,"originalLine":13,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":35,"generatedColumn":0,"originalLine":13,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":35,"generatedColumn":11,"originalLine":13,"originalColumn":7,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":35,"generatedColumn":36,"originalLine":14,"originalColumn":3,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":37,"generatedColumn":0,"originalLine":14,"originalColumn":3,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":37,"generatedColumn":0,"originalLine":14,"originalColumn":3,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":37,"generatedColumn":1,"originalLine":14,"originalColumn":3,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":37,"generatedColumn":14,"originalLine":14,"originalColumn":9,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":37,"generatedColumn":14,"originalLine":14,"originalColumn":9,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":37,"generatedColumn":19,"originalLine":14,"originalColumn":13,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":37,"generatedColumn":23,"originalLine":14,"originalColumn":3,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":38,"generatedColumn":0,"originalLine":14,"originalColumn":3,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":39,"generatedColumn":0,"originalLine":14,"originalColumn":3,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":40,"generatedColumn":0,"originalLine":14,"originalColumn":3,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":41,"generatedColumn":0,"originalLine":14,"originalColumn":3,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":45,"generatedColumn":0,"originalLine":16,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":46,"generatedColumn":0,"originalLine":16,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":46,"generatedColumn":6,"originalLine":16,"originalColumn":11,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":48,"generatedColumn":0,"originalLine":16,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":48,"generatedColumn":6,"originalLine":16,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":48,"generatedColumn":7,"originalLine":16,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":48,"generatedColumn":7,"originalLine":16,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":48,"generatedColumn":13,"originalLine":16,"originalColumn":15,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":51,"generatedColumn":0,"originalLine":16,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":51,"generatedColumn":0,"originalLine":16,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":51,"generatedColumn":6,"originalLine":16,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":51,"generatedColumn":6,"originalLine":16,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":51,"generatedColumn":12,"originalLine":16,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":53,"generatedColumn":0,"originalLine":16,"originalColumn":6,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":53,"generatedColumn":6,"originalLine":16,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":53,"generatedColumn":6,"originalLine":16,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":53,"generatedColumn":12,"originalLine":16,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":55,"generatedColumn":0,"originalLine":17,"originalColumn":3,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":55,"generatedColumn":0,"originalLine":17,"originalColumn":3,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":55,"generatedColumn":0,"originalLine":17,"originalColumn":3,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":55,"generatedColumn":12,"originalLine":17,"originalColumn":9,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":55,"generatedColumn":36,"originalLine":18,"originalColumn":4,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":57,"generatedColumn":0,"originalLine":18,"originalColumn":4,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":57,"generatedColumn":0,"originalLine":18,"originalColumn":4,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":57,"generatedColumn":1,"originalLine":18,"originalColumn":4,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":57,"generatedColumn":1,"originalLine":18,"originalColumn":4,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":57,"generatedColumn":11,"originalLine":18,"originalColumn":7,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":60,"generatedColumn":0,"originalLine":20,"originalColumn":3,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":60,"generatedColumn":0,"originalLine":20,"originalColumn":3,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":60,"generatedColumn":1,"originalLine":20,"originalColumn":3,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":60,"generatedColumn":1,"originalLine":20,"originalColumn":3,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":64,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":65,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":65,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":65,"generatedColumn":1,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":65,"generatedColumn":14,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":65,"generatedColumn":17,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":66,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":67,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":68,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":69,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":72,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":72,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":72,"generatedColumn":1,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":72,"generatedColumn":14,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":72,"generatedColumn":17,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":73,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":74,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":75,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":76,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":79,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":79,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":79,"generatedColumn":1,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":79,"generatedColumn":14,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":79,"generatedColumn":17,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":80,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":81,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":82,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":83,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":86,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":86,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":86,"generatedColumn":1,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":86,"generatedColumn":14,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":86,"generatedColumn":17,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":87,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":88,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":89,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null},{"source":"file:///home/example/Test.hx","generatedLine":90,"generatedColumn":0,"originalLine":22,"originalColumn":2,"name":null}] 2 | -------------------------------------------------------------------------------- /test/data/test.map: -------------------------------------------------------------------------------- 1 | { 2 | "version":3, 3 | "file":"bin/bug/lib/Bug.php", 4 | "sourceRoot":"file://", 5 | "sources":["/home/example/Test.hx"], 6 | "names":[], 7 | "mappings":";;;;;;;;;;;;;;;;;;;;;;AAKkB;;;;;;AAIM;;AACtB,AAAA,AAAA,YAAM;;AACN,KAAQ,AAAA,AAAA,YAAM;;AACd,AAAA,AAAA,WAAK,yBACJ;;AAAA,AAAA,CAAA,aAAM,AAAA,KAAI,IAAV;AAAA;AAAA;AAAA;AAAA;;;;AAED;AAAA,MAAS;;AAAT,MAAA,CAAA,AAAA,MAAa;;;AAAb,AAAA,MAAA,AAAA,MAAA;;AAAI,MAAJ,AAAA,MAAA;;AACC,AAAA,AAAA,YAAM,wBACL;;AAAA,AAAA,CAAA,AAAA,UAAG;;;AAEJ,AAAA,CAAA,AAAA;;;;AAED;AAAA,AAAA,CAAA,aAAA,GAAA;AAAA;AAAA;AAAA;AAAA;;;AAAA,AAAA,CAAA,aAAA,GAAA;AAAA;AAAA;AAAA;AAAA;;;AAAA,AAAA,CAAA,aAAA,GAAA;AAAA;AAAA;AAAA;AAAA;;;AAAA,AAAA,CAAA,aAAA,GAAA;AAAA;AAAA;AAAA;AAAA;;;;;;;;" 8 | } -------------------------------------------------------------------------------- /test/js-minified-header.js: -------------------------------------------------------------------------------- 1 | /** @suppress {duplicate} */ 2 | var global; 3 | /** @suppress {duplicate} */ 4 | var phantom; 5 | /** @suppress {duplicate} */ 6 | var process; --------------------------------------------------------------------------------