1 <script> 2 3 var obj = { 4 objField: 30 5 }; 6 7 function handleLoad(e) { 8 new C().m(); 9 } 10 11 function C() { 12 this.a = 10; 13 this.timestamp = Date.now(); 14 } 15 16 C.prototype.m = function() { 17 this.timestamp = Date.now(); 18 with (obj) { 19 debugger; 20 objField++; 21 } 22 var self = this; 23 setTimeout(function() { 24 self.m(); 25 }, 1000); 26 }; 27 28 29 </script> 30 <body onload="handleLoad(event)"> 31 32 <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> 33 <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> 34 </body> 35 36