This has happened for the second time now and as you can imagine, a debugger that shows wrong information is the worst thing that can happen when debugging. What happens is that when using source maps that debugger thinks the VM is at a certain line, but actually it's not yet there, or worse, will never reach this line. The source maps are generated with the Grunt uglify plugin, which uses UglifyJS2.
An example:
if(something === 1){
console.log("it's something"); // debugger thinks the VM is here
else{
console.log("no it's not"); // while actually it's here
}
This did then print no it's not
although the debugger jumped into the if
The other example I experienced was:
var that = this;
some.functionCall(1, function(){
console.log(that); //this is where the debugger thinks the vm is
// debugger: that = undefined
// console prints nothing to that point
});
When I continued the program the console.log(that)
did fire eventually.
Did anyone else experience the same problem? Is it more likely a problem of UglifyJS2 or of Google Chrome?
Chrome Version: 38.0.2125.8 dev (64-bit)
Uglify2JS: 2.4.0
grunt-contrib-uglify: 0.5.1