<script>
var obj = {
objField: 30
};
function handleLoad(e) {
new C().m();
}
function C() {
this.a = 10;
this.timestamp = Date.now();
}
C.prototype.m = function() {
this.timestamp = Date.now();
with (obj) {
debugger;
objField++;
}
var self = this;
setTimeout(function() {
self.m();
}, 1000);
};
</script>
<body onload="handleLoad(event)">
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=34161"> 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>
</body>