Originally reported on Google Code with ID 2387
Closure variables hidden from debugger when using JS "module" pattern.
An example:
function context(){
var list = [{test:1},{test:4},{test:6,abc:4}];
return {
Lookup:function(){
// what is the value of list?
debugger;
var value = list[0];
// value has a value, even though list does not
// as seen in firebug
return value;
}
}
}
var c = context();
var v = c.Lookup();
When the debugger stops, there is no value for list, even though when you
step over the next line, value does indeed get set. This makes debugging
code that is written in this pattern difficult.
Firebug 1.5a26+ (14 Oct 2009) on Fx 3.5
Reported by sroussey on 2009-10-15 17:57:21
- Attachment: issue-2387.html
该提问来源于开源项目:firebug/firebug