This seems to be happening most often when the breakpoint is inside a lambda, and the lambda expression (not the body, but the function-expression that yields the function object) is not evaluated yet - the breakpoint is then moved to the first line outside the lambda.
Normally, the breakpoint is then moved back inside once the lambda expression is evaluated. However, in some complicated scenarios, the moved breakpoint is hit before it can be moved back to where it belongs. If that happens, it will not be moved back inside the lambda from there on.
Here's the minimal repro that I could make:
```
var express = require('express');
var n = 0;
var app = express();
x = 0;
while (x != 2) {
try {
if (x == 1) throw 0;
else x = 1;
} catch (ex) {
x = 2;
app.get('/', function (req, res) {
n = 1;
res.send('Hello World');
});
}
var port = process.env.port || 1337;
}
app.listen(port);
console.log('Listening on port ' + port);
```
Set the breakpoint on the first line of the lambda, at ```n=1```, and run it. It will move BP to ```var port```, and hit it. The second iteration will hit that line again, even though the lambda is now created. Letting it run further and opening the URL will eval the body of the lambda, where you'd expect the original breakpoint to be, but it is still not hit. Furthermore, attempting to create a new BP on the first line of the lambda at that point just reuses the existing (wrong) one.
Normally, the breakpoint is then moved back inside once the lambda expression is evaluated. However, in some complicated scenarios, the moved breakpoint is hit before it can be moved back to where it belongs. If that happens, it will not be moved back inside the lambda from there on.
Here's the minimal repro that I could make:
```
var express = require('express');
var n = 0;
var app = express();
x = 0;
while (x != 2) {
try {
if (x == 1) throw 0;
else x = 1;
} catch (ex) {
x = 2;
app.get('/', function (req, res) {
n = 1;
res.send('Hello World');
});
}
var port = process.env.port || 1337;
}
app.listen(port);
console.log('Listening on port ' + port);
```
Set the breakpoint on the first line of the lambda, at ```n=1```, and run it. It will move BP to ```var port```, and hit it. The second iteration will hit that line again, even though the lambda is now created. Letting it run further and opening the URL will eval the body of the lambda, where you'd expect the original breakpoint to be, but it is still not hit. Furthermore, attempting to create a new BP on the first line of the lambda at that point just reuses the existing (wrong) one.