Commit 370c66a
committed
Fix a crash when the segment does not point to a source file
With the following example:
```js
var foo = function () {
return 4;
};
//# sourceMappingURL=data:application/json;charset=utf-8;base64,ewogICJtYXBwaW5ncyI6ICJBQUFBLElBQUEsR0FBQSxHQUFVLFk7U0FBTSxDO0FBQUMsQ0FBakIiLAogICJuYW1lcyI6IFtdLAogICJzb3VyY2VzIjogWyJvcmlnaW5hbC5qcyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsidmFyIGZvbyA9ICgpID0+IDQ7Il0sCiAgInZlcnNpb24iOiAzCn0K
```
Hovering over the `{` or `;` (on line 2) causes a crash. The actually mappings looks like:
```
AAAA,IAAA,GAAA,GAAU,Y;SAAM,C;AAAC,CAAjB
```
Where the `Y` and `C` segments do not have a `sourcesIndex`/`sourceLine`/`sourceColumn` VLQ. This defaults the source `index` variable here to `-1`, which causes the crash.1 parent 7a479ec commit 370c66a
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
479 | | - | |
| 479 | + | |
480 | 480 | | |
481 | 481 | | |
482 | 482 | | |
| |||
0 commit comments