Skip to content

Conversation

@jridgewell
Copy link
Contributor

@jridgewell jridgewell commented Jan 28, 2022

With the following example:

var foo = function () { return 4; }; //# sourceMappingURL=data:application/json;charset=utf-8;base64,ewogICJtYXBwaW5ncyI6ICJBQUFBLElBQUEsR0FBQSxHQUFVLFk7U0FBTSxDO0FBQUMsQ0FBakIiLAogICJuYW1lcyI6IFtdLAogICJzb3VyY2VzIjogWyJvcmlnaW5hbC5qcyJdLAogICJzb3VyY2VzQ29udGVudCI6IFsidmFyIGZvbyA9ICgpID0+IDQ7Il0sCiAgInZlcnNpb24iOiAzCn0K

Hovering over the { or ; (on line 2) in the Generated Code section causes a crash. The actual 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.

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.
@jridgewell
Copy link
Contributor Author

jridgewell commented Feb 17, 2022

One more friendly paying @evanw

Example with the new sharable URLs

@evanw
Copy link
Owner

evanw commented Feb 18, 2022

Sure thing. Thanks!

@evanw evanw merged commit 9123494 into evanw:gh-pages Feb 18, 2022
@jridgewell jridgewell deleted the source-less branch February 18, 2022 20:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants