debugger-scopes-inspection.html   [plain text]


var obj = {
  objField: 30

function handleLoad(e) {
  new C().m();

function C() {
  this.a = 10;
  this.timestamp =;

C.prototype.m = function() {
  this.timestamp =;
  with (obj) {
  var self = this;
  setTimeout(function() {
     }, 1000);

<body onload="handleLoad(event)">

<p>Test for <a href=""> Bug 34161 -  Local scope is shown as With scope in scope chain pane </a>.</p>
<p>To test, open the Inspector and start a debugging session. In a second debugger will pause. While paused look at scope chain pane. There should be three scopes: 'With scope' containing objField variable, 'Local scope' with this and self variables and 'Global scope'. All scopes but 'Global' should be expanced. 'Global' scope should be collapsed(it takes too long to expand DOMWindow so we prefer to do it on demand). </p>