none
Sourcemap generated by uglifyjs with a getter is not handled by Visual Studio.

    Question

  • var index = function index() { };

    index.prototype = {
      get getter() {
        return null;
      }
    }

    if you generate a sourcemap for it with for example uglifyjs it will generate this:

    {
       "version": 3,
       "file": "index.min.js",
       "sources": [
          "index.js"
       ],
       "names": [
          "index",
          "prototype",
          {
             "end": {
                "file": "index.js",
                "comments_before": [],
                "nlb": false,
                "endpos": 70,
                "endcol": 12,
                "endline": 4,
                "pos": 64,
                "col": 6,
                "line": 4,
                "value": "getter",
                "type": "name"
             },
             "start": {
                "file": "index.js",
                "comments_before": [],
                "nlb": false,
                "endpos": 70,
                "endcol": 12,
                "endline": 4,
                "pos": 64,
                "col": 6,
                "line": 4,
                "value": "getter",
                "type": "name"
             },
             "name": "getter"
          },
          "getter"
       ],
       "mappings": "AAAA,GAAIA,OAAQ,QAASA,UAErBA,OAAMC,WACJC,GAAIC,UACF,MAAO"
    }

    This object notation does not work when debugging with Visual Studio 2015.

    SourceMap C:\dev\vs_sourcemap\index.min.js.map read failed: Error reading string. Unexpected token: StartObject. Path 'names[2]', line 1, position 88.

    Monday, November 2, 2015 11:46 AM

Answers