先看如下代码示例:
1
ToolBar.prototype.Dispose = function()
2
{
3
var elmt = this.GetElement(); ***
4
elmt.onselectstart = '';
5
elmt.oncontentmenu = '';
6
elmt.clearAttributes();
7
// todo 
8
}
2
3
4
5
6
7
8
我的代码运行在这里出了错,调试器VS.NET把代码执行光标停在了第4行,而且不让我拖拽上去。我想如果能拖上去就可以step into的跟踪以下this.GetElement()方法嘛。既然不能拖,我就在第3行设一个breakpoint呗,设好后attach调试器,怎么不能停到代码行3的地方呢?在调试器一看,断点被VS.NET自动设到第一行代码上去了,并且整个的ToolBar.prototype.Dispose方法都是被highlight了@_@。于是我想手动把breakpoint再设置到第3行代马上去,却怎么也不能成功。一在第3行上设置breakpoint就会自动跳到第1行
今天发现可以这么来解决这个问题,把ToolBar.prototype.Dispose = function()改成:function ToolBar.prototype.Dispose()就行了!真是怪!~
1
function ToolBar.prototype.Dispose()
2
{
3
var elmt = this.GetElement(); ***
4
elmt.onselectstart = '';
5
elmt.oncontentmenu = '';
6
elmt.clearAttributes();
7
// todo
8
}
2
3
4
5
6
7
8
上面这个方法,就可以随意的在第3行上设置breakpoint。这个问题同时存在于VS.NET 2003和VS.NET 2005 beta1中。谁有空拿VS.NET 2005 beta2看看这个问题还有没有。