| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7c6f548 commit 705e85e
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -99,6 +99,20 @@ const { readFileSync } = require('fs'); | |||
| 99 | 99 | assert.notStrictEqual(payload.sources, sourceMap.payload.sources); | |
| 100 | 100 | } | |
| 101 | 101 | ||
| 102 | + // findEntry() must return empty object instead error when | ||
| 103 | + // receive a malformed mappings. | ||
| 104 | + { | ||
| 105 | + const payload = JSON.parse(readFileSync( | ||
| 106 | + require.resolve('../fixtures/source-map/disk.map'), 'utf8' | ||
| 107 | + )); | ||
| 108 | + payload.mappings = ';;;;;;;;;'; | ||
| 109 | + | ||
| 110 | + const sourceMap = new SourceMap(payload); | ||
| 111 | + const result = sourceMap.findEntry(0, 5); | ||
| 112 | + assert.strictEqual(typeof result, 'object'); | ||
| 113 | + assert.strictEqual(Object.keys(result).length, 0); | ||
| 114 | + } | ||
| 115 | + | ||
| 102 | 116 | // Test various known decodings to ensure decodeVLQ works correctly. | |
| 103 | 117 | { | |
| 104 | 118 | function makeMinimalMap(column) { | |
| Back | FazBrowse Home | New Git URL |
0 commit comments