<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[194251] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/194251">194251</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2015-12-17 17:09:13 -0800 (Thu, 17 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Provide a way to distinguish a nested lexical block from a function's lexical block
https://bugs.webkit.org/show_bug.cgi?id=152361

Reviewed by Saam Barati.

Source/JavaScriptCore:

* bytecompiler/BytecodeGenerator.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::initializeDefaultParameterValuesAndSetupFunctionScopeStack):
(JSC::BytecodeGenerator::initializeArrowFunctionContextScopeIfNeeded):
(JSC::BytecodeGenerator::emitPushFunctionNameScope):
(JSC::BytecodeGenerator::emitPushCatchScope):
Each of these are specialized scopes. They are not nested lexical scopes.

(JSC::BytecodeGenerator::pushLexicalScope):
(JSC::BytecodeGenerator::pushLexicalScopeInternal):
Include an extra parameter to mark the SymbolTable as a nested lexical or not.

* bytecompiler/NodesCodegen.cpp:
(JSC::BlockNode::emitBytecode):
(JSC::ForNode::emitBytecode):
(JSC::ForInNode::emitMultiLoopBytecode):
(JSC::ForOfNode::emitBytecode):
(JSC::SwitchNode::emitBytecode):
(JSC::ClassExprNode::emitBytecode):
Each of these are cases of non-function nested lexical scopes.
So mark the SymbolTable as nested.

* inspector/protocol/Debugger.json:
* inspector/InjectedScriptSource.js:
Include a new scope type.

* inspector/JSJavaScriptCallFrame.h:
* inspector/JSJavaScriptCallFrame.cpp:
(Inspector::JSJavaScriptCallFrame::scopeType):
Use the new &quot;NestedLexical&quot; scope type for nested, non-function,
lexical scopes. The Inspector can use this to better describe
this scope in the frontend.

* debugger/DebuggerScope.cpp:
(JSC::DebuggerScope::isNestedLexicalScope):
* debugger/DebuggerScope.h:
* runtime/JSScope.cpp:
(JSC::JSScope::isNestedLexicalScope):
* runtime/JSScope.h:
* runtime/SymbolTable.cpp:
(JSC::SymbolTable::SymbolTable):
(JSC::SymbolTable::cloneScopePart):
* runtime/SymbolTable.h:
Access the isNestedLexicalScope bit.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
(WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection):
New &quot;Block Variables&quot; string.

* UserInterface/Models/ScopeChainNode.js:
New &quot;Block&quot; scope type, and update existing types.

* UserInterface/Controllers/DebuggerManager.js:
(WebInspector.DebuggerManager.prototype._scopeChainNodeFromPayload):
Parse the protocol type to frontend types. Use the protocol generated enum.

LayoutTests:

* inspector/debugger/breakpoint-scope-expected.txt:
We will soon remove the backend sending a &quot;Local&quot; scope.
The backend was just marking the first closure scope as local.
The frontend can do this itself and do a better job of it.

* inspector/model/resources/all-scopes.js: Added.
(testAllScopes.innerScope):
(testAllScopes):
* inspector/model/resources/block-scopes.js: Added.
(testBlockScopes):
(testBlockScopes.method):
* inspector/model/resources/function-name-scopes.js: Added.
(testFunctionNameScope1):
* inspector/model/scope-chain-node-expected.txt: Added.
* inspector/model/scope-chain-node.html: Added.
Tests for ways to get all the different scope types and
specific cases of certain scope types.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerbreakpointscopeexpectedtxt">trunk/LayoutTests/inspector/debugger/breakpoint-scope-expected.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp">trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh">trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebytecompilerNodesCodegencpp">trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredebuggerDebuggerScopecpp">trunk/Source/JavaScriptCore/debugger/DebuggerScope.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredebuggerDebuggerScopeh">trunk/Source/JavaScriptCore/debugger/DebuggerScope.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorInjectedScriptSourcejs">trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSJavaScriptCallFramecpp">trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJSJavaScriptCallFrameh">trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorprotocolDebuggerjson">trunk/Source/JavaScriptCore/inspector/protocol/Debugger.json</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSScopecpp">trunk/Source/JavaScriptCore/runtime/JSScope.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSScopeh">trunk/Source/JavaScriptCore/runtime/JSScope.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeSymbolTablecpp">trunk/Source/JavaScriptCore/runtime/SymbolTable.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeSymbolTableh">trunk/Source/JavaScriptCore/runtime/SymbolTable.h</a></li>
<li><a href="#trunkSourceWebInspectorUIChangeLog">trunk/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs">trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceControllersDebuggerManagerjs">trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceModelsScopeChainNodejs">trunk/Source/WebInspectorUI/UserInterface/Models/ScopeChainNode.js</a></li>
<li><a href="#trunkSourceWebInspectorUIUserInterfaceViewsScopeChainDetailsSidebarPaneljs">trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/inspector/model/resources/</li>
<li><a href="#trunkLayoutTestsinspectormodelresourcesallscopesjs">trunk/LayoutTests/inspector/model/resources/all-scopes.js</a></li>
<li><a href="#trunkLayoutTestsinspectormodelresourcesblockscopesjs">trunk/LayoutTests/inspector/model/resources/block-scopes.js</a></li>
<li><a href="#trunkLayoutTestsinspectormodelresourcesfunctionnamescopesjs">trunk/LayoutTests/inspector/model/resources/function-name-scopes.js</a></li>
<li><a href="#trunkLayoutTestsinspectormodelscopechainnodeexpectedtxt">trunk/LayoutTests/inspector/model/scope-chain-node-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectormodelscopechainnodehtml">trunk/LayoutTests/inspector/model/scope-chain-node.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/LayoutTests/ChangeLog        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2015-12-17  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Provide a way to distinguish a nested lexical block from a function's lexical block
+        https://bugs.webkit.org/show_bug.cgi?id=152361
+
+        Reviewed by Saam Barati.
+
+        * inspector/debugger/breakpoint-scope-expected.txt:
+        We will soon remove the backend sending a &quot;Local&quot; scope.
+        The backend was just marking the first closure scope as local.
+        The frontend can do this itself and do a better job of it.
+
+        * inspector/model/resources/all-scopes.js: Added.
+        (testAllScopes.innerScope):
+        (testAllScopes):
+        * inspector/model/resources/block-scopes.js: Added.
+        (testBlockScopes):
+        (testBlockScopes.method):
+        * inspector/model/resources/function-name-scopes.js: Added.
+        (testFunctionNameScope1):
+        * inspector/model/scope-chain-node-expected.txt: Added.
+        * inspector/model/scope-chain-node.html: Added.
+        Tests for ways to get all the different scope types and
+        specific cases of certain scope types.
+
</ins><span class="cx"> 2015-12-17  Keith Miller  &lt;keith_miller@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [ES6] Add support for Symbol.hasInstance
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerbreakpointscopeexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/debugger/breakpoint-scope-expected.txt (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/breakpoint-scope-expected.txt        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/LayoutTests/inspector/debugger/breakpoint-scope-expected.txt        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -3,12 +3,12 @@
</span><span class="cx"> 
</span><span class="cx"> Starting Test
</span><span class="cx"> Hit breakpoint at line: 4, column: 8
</span><del>-scope-chain-type-local properties:
</del><ins>+scope-chain-type-closure properties:
</ins><span class="cx">     resolve
</span><span class="cx">     reject
</span><span class="cx"> scope-chain-type-closure properties:
</span><span class="cx">     p
</span><del>-scope-chain-type-globalLexicalEnvironment properties:
</del><ins>+scope-chain-type-global-lexical-environment properties:
</ins><span class="cx">     lexicalVariable
</span><span class="cx"> scope-chain-type-global (properties not listed)
</span><span class="cx"> Tests done
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelresourcesallscopesjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/model/resources/all-scopes.js (0 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/resources/all-scopes.js                                (rev 0)
+++ trunk/LayoutTests/inspector/model/resources/all-scopes.js        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+// Global
+var globalVariable = 1;
+
+// GlobalLexicalEnvironment
+let lexicalGlobalVariable = 2;
+
+function testAllScopes() {
+    // Closure
+    var closureVariable1 = 3;
+    let closureVariable2 = 4;
+
+    function innerScope() {
+        // Closure
+        var innerClosureVariable1 = 5;
+        let innerClosureVariable2 = 6;
+
+        // With (the object)
+        with ({withObjectProperty: 7, __proto__: null}) {
+            // Block
+            let withBlockVariable = 8;
+
+            // Catch (the `e` object)
+            try {
+                throw 9;
+            } catch (exceptionVariable) {
+                // Block
+                let catchBlockVariable = 10;
+
+                // Function Name
+                (function functionName() {
+
+                    // Closure (&quot;Local&quot;)
+                    var localVariable1 = 11;
+                    let localVariable2 = 12;
+
+                    console.log(&quot;Variables&quot;,
+                        globalVariable,
+                        lexicalGlobalVariable,
+                        closureVariable1, closureVariable2,
+                        innerClosureVariable1, innerClosureVariable2,
+                        withBlockVariable,
+                        exceptionVariable,
+                        catchBlockVariable,
+                        functionName.name,
+                        localVariable1, localVariable2);
+
+                    // Pause.
+                    debugger;
+                })();
+            }
+        }
+    }
+
+    innerScope();
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectormodelresourcesblockscopesjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/model/resources/block-scopes.js (0 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/resources/block-scopes.js                                (rev 0)
+++ trunk/LayoutTests/inspector/model/resources/block-scopes.js        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -0,0 +1,147 @@
</span><ins>+function testBlockScopes() {
+    // Normal (not Block)
+    let a = 1;
+    console.log(&quot;normal&quot;, a);
+    debugger; // 1
+    
+    // If
+    if (true) {
+        let a = 990;
+        console.log(&quot;if&quot;, a);
+        debugger; // 2
+    }
+
+    // Else
+    if (false) {}
+    else {
+        let a = 991;
+        console.log(&quot;else&quot;, a);
+        debugger; // 3
+    }
+
+    // While
+    while (true) {
+        let a = 992;
+        console.log(&quot;while&quot;, a);
+        debugger; // 4
+        break;
+    }
+
+    // Do/While
+    do {
+        let a = 993;
+        console.log(&quot;do&quot;, a);
+        debugger; // 5
+    } while (false);
+
+    // For
+    for (let a = 994; true; ++a) {
+        console.log(&quot;for&quot;, a);
+        debugger; // 6
+        break;
+    }
+
+    // ForIn
+    for (let a in ({&quot;995&quot;:1})) {
+        console.log(&quot;for-in&quot;, a);
+        debugger; // 7
+        break;
+    }
+
+    // ForOf
+    for (let a of [996]) {
+        console.log(&quot;for-of&quot;, a);
+        debugger; // 8
+        break;
+    }
+
+    // Switch
+    switch (&quot;test&quot;) {
+    case &quot;test&quot;:
+        let a = 997;
+        console.log(&quot;case&quot;, a);
+        debugger; // 9
+        // fallthrough
+    default:
+        a += 0.5;
+        console.log(&quot;default&quot;, a);
+        debugger; // 10
+        break;
+    }
+
+    // Try
+    try {
+        let a = 998;
+        console.log(&quot;try&quot;, a);
+        debugger; // 11
+    } catch (e) {}
+
+    // Catch
+    try {
+        throw &quot;Error&quot;;
+    } catch (e) {
+        let a = 999;
+        console.log(&quot;catch&quot;, a);
+        debugger; // 12
+    }
+
+    // Finally
+    try {}
+    finally {
+        let a = 1000;
+        console.log(&quot;finally&quot;, a);
+        debugger; // 13
+    }
+
+    // Anonymous block.
+    {
+        let a = 1001;
+        console.log(&quot;block&quot;, a);
+        debugger; // 14
+    }
+
+    // With block.
+    with ({something:true,__proto__:null}) {
+        let a = 1002;
+        console.log(&quot;with&quot;, a);
+        debugger; // 15
+    }
+
+    // Nested blocks.
+    {
+        let a = 1003;
+        {
+            let a = 1004;
+            {
+                let a = 1005;
+                {
+                    let a = 1006;
+                    console.log(&quot;nested blocks&quot;, a);
+                    debugger; // 16
+                }
+            }
+        }
+    }
+
+    // Class (method)
+    (new (class MyClass {
+        method() {
+            // Block Variable scope containing the Class identifier `MyClass`.
+            console.log(&quot;class (method)&quot;);
+            debugger; // 17
+        }
+    })).method();
+
+    // Class (static method)
+    (class MyClassWithStaticMethod {
+        static staticMethod() {
+            // Block Variable scope containing the Class identifier `MyClass`.
+            console.log(&quot;class (static)&quot;);
+            debugger; // 18
+        }
+    }).staticMethod();
+
+    // Normal (not Block)
+    console.log(&quot;normal&quot;, a);
+    debugger; // 19
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectormodelresourcesfunctionnamescopesjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/model/resources/function-name-scopes.js (0 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/resources/function-name-scopes.js                                (rev 0)
+++ trunk/LayoutTests/inspector/model/resources/function-name-scopes.js        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+function testFunctionNameScope1() {
+    (function functionName() {
+        debugger;
+    })();
+}
+
+function testFunctionNameScope2() {
+    (class MyClass {
+        static staticMethod() {
+            debugger;
+        }
+    }).staticMethod();
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectormodelscopechainnodeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/model/scope-chain-node-expected.txt (0 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/scope-chain-node-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/model/scope-chain-node-expected.txt        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -0,0 +1,136 @@
</span><ins>+CONSOLE MESSAGE: line 36: Variables
+CONSOLE MESSAGE: line 4: normal
+CONSOLE MESSAGE: line 10: if
+CONSOLE MESSAGE: line 18: else
+CONSOLE MESSAGE: line 25: while
+CONSOLE MESSAGE: line 33: do
+CONSOLE MESSAGE: line 39: for
+CONSOLE MESSAGE: line 46: for-in
+CONSOLE MESSAGE: line 53: for-of
+CONSOLE MESSAGE: line 62: case
+CONSOLE MESSAGE: line 67: default
+CONSOLE MESSAGE: line 75: try
+CONSOLE MESSAGE: line 84: catch
+CONSOLE MESSAGE: line 92: finally
+CONSOLE MESSAGE: line 99: block
+CONSOLE MESSAGE: line 106: with
+CONSOLE MESSAGE: line 119: nested blocks
+CONSOLE MESSAGE: line 130: class (method)
+CONSOLE MESSAGE: line 139: class (static)
+CONSOLE MESSAGE: line 145: normal
+Tests for the WebInspector.ScopeChainNode model object.
+
+
+== Running test suite: WebInspector.ScopeChainNode
+-- Running test case: WebInspector.ScopeChainNode.AllTypes
+PASS: ScopeChain should have 13 scopes.
+SCOPE CHAIN:
+    Closure
+      - localVariable2: 12
+    Closure
+      - localVariable1: 11
+    FunctionName
+      - functionName: function functionName() {
+    Block
+      - catchBlockVariable: 10
+    Catch
+      - exceptionVariable: 9
+    Block
+      - withBlockVariable: 8
+    With
+      - withObjectProperty: 7
+    Closure
+      - innerClosureVariable2: 6
+    Closure
+      - innerClosureVariable1: 5
+    Closure
+      - closureVariable2: 4
+    Closure
+      - closureVariable1: 3
+      - innerScope: function innerScope() {
+    GlobalLexicalEnvironment
+      - lexicalGlobalVariable: 2
+    Global
+
+-- Running test case: WebInspector.ScopeChainNode.FunctionNameInFunctionExpression
+SCOPE CHAIN:
+    Closure
+    FunctionName
+      - functionName: function functionName() {
+    Closure
+    GlobalLexicalEnvironment
+      - lexicalGlobalVariable: 2
+    Global
+
+-- Running test case: WebInspector.ScopeChainNode.FunctionNameInClassMethod
+SCOPE CHAIN:
+    Closure
+    FunctionName
+      - staticMethod: function staticMethod() {
+    Block
+      - MyClass: class MyClass
+    Closure
+    GlobalLexicalEnvironment
+      - lexicalGlobalVariable: 2
+    Global
+
+-- Running test case: WebInspector.ScopeChainNode.BlockScopes
+PASS: Pause #1 - Top scope should be normal function Closure/Local scope.
+PASS: Pause #2 - Top scope should be Block scope.
+PASS: Pause #3 - Top scope should be Block scope.
+PASS: Pause #4 - Top scope should be Block scope.
+PASS: Pause #5 - Top scope should be Block scope.
+PASS: Pause #6 - Top scope should be Block scope.
+PASS: Pause #7 - Top scope should be Block scope.
+PASS: Pause #8 - Top scope should be Block scope.
+PASS: Pause #9 - Top scope should be Block scope.
+PASS: Pause #10 - Top scope should be Block scope.
+PASS: Pause #11 - Top scope should be Block scope.
+PASS: Pause #12 - Top scope should be Block scope.
+PASS: Pause #13 - Top scope should be Block scope.
+PASS: Pause #14 - Top scope should be Block scope.
+PASS: Pause #15 - Top scope should be Block scope.
+PASS: Pause #16 - Contains a Block scope.
+SCOPE CHAIN:
+    Block
+      - a: 1006
+    Block
+      - a: 1005
+    Block
+      - a: 1004
+    Block
+      - a: 1003
+    Closure
+      - a: 1
+    Closure
+    GlobalLexicalEnvironment
+      - lexicalGlobalVariable: 2
+    Global
+PASS: Pause #17 - Contains a Block scope.
+SCOPE CHAIN:
+    Closure
+    FunctionName
+      - method: function method() {
+    Block
+      - MyClass: class MyClass
+    Closure
+      - a: 1
+    Closure
+    GlobalLexicalEnvironment
+      - lexicalGlobalVariable: 2
+    Global
+PASS: Pause #18 - Contains a Block scope.
+SCOPE CHAIN:
+    Closure
+    FunctionName
+      - staticMethod: function staticMethod() {
+    Block
+      - MyClassWithStaticMethod: class MyClassWithStaticMethod
+    Closure
+      - a: 1
+    Closure
+    GlobalLexicalEnvironment
+      - lexicalGlobalVariable: 2
+    Global
+PASS: Pause #19 - Top scope should be normal function Closure/Local scope.
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectormodelscopechainnodehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/model/scope-chain-node.html (0 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/scope-chain-node.html                                (rev 0)
+++ trunk/LayoutTests/inspector/model/scope-chain-node.html        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -0,0 +1,160 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script src=&quot;../../http/tests/inspector/resources/inspector-test.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/all-scopes.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/function-name-scopes.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/block-scopes.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+function test()
+{
+    function firstLine(str) {
+        let newlineIndex = str.indexOf(&quot;\n&quot;);
+        if (newlineIndex !== -1)
+            return str.substr(0, newlineIndex);
+        return str;
+    }
+
+    function scopeTypeToString(type) {
+        for (let key in WebInspector.ScopeChainNode.Type) {
+            if (WebInspector.ScopeChainNode.Type[key] === type)
+                return key;
+        }
+        return &quot;Unexpected Scope Type&quot;;
+    }
+
+    function harvestScopeChain(scopeChain) {        
+        let promises = [];
+        for (let scope of scopeChain) {
+            promises.push(new Promise((resolve, reject) =&gt; {
+                if (scope.type === WebInspector.ScopeChainNode.Type.Global)
+                    resolve({scope, propertyDescriptors: []});
+                else {
+                    scope.object.getDisplayablePropertyDescriptors((propertyDescriptors) =&gt; {
+                        resolve({scope, propertyDescriptors});
+                    });
+                }
+            }));
+        }
+        return Promise.all(promises);
+    }
+
+    function logScopeChain(scopeChain) {
+        return harvestScopeChain(scopeChain).then((results) =&gt; {
+            InspectorTest.log(&quot;SCOPE CHAIN:&quot;);
+            for (let {scope, propertyDescriptors} of results) {
+                InspectorTest.log(`    ${scopeTypeToString(scope.type)}`);
+                if (scope.type !== WebInspector.ScopeChainNode.Type.Global) {
+                    for (let descriptor of propertyDescriptors)
+                        InspectorTest.log(`      - ${descriptor.name}: ${firstLine(descriptor.value.description)}`);
+                }
+            }
+            return results;
+        });
+    }
+
+
+    let suite = InspectorTest.createAsyncSuite(&quot;WebInspector.ScopeChainNode&quot;);
+
+    InspectorTest.dumpActivityToSystemConsole = true;
+    InspectorBackend.dumpInspectorProtocolMessages = true;
+
+    suite.addTestCase({
+        name: &quot;WebInspector.ScopeChainNode.AllTypes&quot;,
+        description: &quot;Tests for each of the different scope chain node types.&quot;,
+        test: (resolve, reject) =&gt; {
+            InspectorTest.evaluateInPage(&quot;setTimeout(testAllScopes)&quot;);
+            WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, (event) =&gt; {
+                let scopeChain = WebInspector.debuggerManager.activeCallFrame.scopeChain;
+                InspectorTest.expectThat(scopeChain.length === 13, &quot;ScopeChain should have 13 scopes.&quot;);
+                logScopeChain(scopeChain).then((result) =&gt; {
+                    WebInspector.debuggerManager.resume();
+                    resolve();
+                });
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;WebInspector.ScopeChainNode.FunctionNameInFunctionExpression&quot;,
+        description: &quot;Tests that there should be a FunctionName scope inside a function expression.&quot;,
+        test: (resolve, reject) =&gt; {
+            InspectorTest.evaluateInPage(&quot;setTimeout(testFunctionNameScope1)&quot;);
+            WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, (event) =&gt; {
+                let scopeChain = WebInspector.debuggerManager.activeCallFrame.scopeChain;
+                logScopeChain(scopeChain).then((result) =&gt; {
+                    WebInspector.debuggerManager.resume();
+                    resolve();
+                });
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;WebInspector.ScopeChainNode.FunctionNameInClassMethod&quot;,
+        description: &quot;Tests that there should be a FunctionName scope inside a class method.&quot;,
+        test: (resolve, reject) =&gt; {
+            InspectorTest.evaluateInPage(&quot;setTimeout(testFunctionNameScope2)&quot;);
+            WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.CallFramesDidChange, (event) =&gt; {
+                let scopeChain = WebInspector.debuggerManager.activeCallFrame.scopeChain;
+                logScopeChain(scopeChain).then((result) =&gt; {
+                    WebInspector.debuggerManager.resume();
+                    resolve();
+                });
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;WebInspector.ScopeChainNode.BlockScopes&quot;,
+        description: &quot;Tests for a Block scope inside all the different types of blocks.&quot;,
+        test: (resolve, reject) =&gt; {
+            InspectorTest.evaluateInPage(&quot;setTimeout(testBlockScopes)&quot;);
+            WebInspector.debuggerManager.addEventListener(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange, callFramesDidChangeListener);
+
+            let pauseCount = 0;
+            let pauseEventsExpected = 19;
+            function callFramesDidChangeListener(event) {
+                pauseCount++;
+                let scopeChain = WebInspector.debuggerManager.activeCallFrame.scopeChain;
+
+                // First, normal function scope.
+                if (pauseCount === 1) {
+                    InspectorTest.expectThat(scopeChain[0].type === WebInspector.ScopeChainNode.Type.Closure, &quot;Pause #1 - Top scope should be normal function Closure/Local scope.&quot;);
+                    WebInspector.debuggerManager.resume();
+                    return;
+                }
+
+                // Last, normal function scope.
+                if (pauseCount === pauseEventsExpected) {
+                    InspectorTest.expectThat(scopeChain[0].type === WebInspector.ScopeChainNode.Type.Closure, `Pause #${pauseCount} - Top scope should be normal function Closure/Local scope.`);
+                    WebInspector.debuggerManager.removeEventListener(WebInspector.DebuggerManager.Event.ActiveCallFrameDidChange, callFramesDidChangeListener);
+                    WebInspector.debuggerManager.resume();
+                    resolve();
+                    return;
+                }
+
+                // The first 15 cases the top scope should be a Block scope.
+                if (pauseCount &lt;= 15) {
+                    InspectorTest.expectThat(scopeChain[0].type === WebInspector.ScopeChainNode.Type.Block, `Pause #${pauseCount} - Top scope should be Block scope.`);
+                    WebInspector.debuggerManager.resume();
+                    return;
+                }
+
+                // Print out the full scope of the last few where there are nested or buried block scopes.
+                InspectorTest.expectThat(scopeChain.some((scopeChain) =&gt; scopeChain.type === WebInspector.ScopeChainNode.Type.Block), `Pause #${pauseCount} - Contains a Block scope.`);
+                logScopeChain(scopeChain).then((result) =&gt; {
+                    WebInspector.debuggerManager.resume();
+                });
+            }
+        }
+    });
+
+    suite.runTestCasesAndFinish();
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+&lt;p&gt;Tests for the WebInspector.ScopeChainNode model object.&lt;/p&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/Source/JavaScriptCore/ChangeLog        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -1,5 +1,57 @@
</span><span class="cx"> 2015-12-17  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Provide a way to distinguish a nested lexical block from a function's lexical block
+        https://bugs.webkit.org/show_bug.cgi?id=152361
+
+        Reviewed by Saam Barati.
+
+        * bytecompiler/BytecodeGenerator.h:
+        * bytecompiler/BytecodeGenerator.cpp:
+        (JSC::BytecodeGenerator::initializeDefaultParameterValuesAndSetupFunctionScopeStack):
+        (JSC::BytecodeGenerator::initializeArrowFunctionContextScopeIfNeeded):
+        (JSC::BytecodeGenerator::emitPushFunctionNameScope):
+        (JSC::BytecodeGenerator::emitPushCatchScope):
+        Each of these are specialized scopes. They are not nested lexical scopes.
+        
+        (JSC::BytecodeGenerator::pushLexicalScope):
+        (JSC::BytecodeGenerator::pushLexicalScopeInternal):
+        Include an extra parameter to mark the SymbolTable as a nested lexical or not.
+
+        * bytecompiler/NodesCodegen.cpp:
+        (JSC::BlockNode::emitBytecode):
+        (JSC::ForNode::emitBytecode):
+        (JSC::ForInNode::emitMultiLoopBytecode):
+        (JSC::ForOfNode::emitBytecode):
+        (JSC::SwitchNode::emitBytecode):
+        (JSC::ClassExprNode::emitBytecode):
+        Each of these are cases of non-function nested lexical scopes.
+        So mark the SymbolTable as nested.
+
+        * inspector/protocol/Debugger.json:
+        * inspector/InjectedScriptSource.js:
+        Include a new scope type.
+
+        * inspector/JSJavaScriptCallFrame.h:
+        * inspector/JSJavaScriptCallFrame.cpp:
+        (Inspector::JSJavaScriptCallFrame::scopeType):
+        Use the new &quot;NestedLexical&quot; scope type for nested, non-function,
+        lexical scopes. The Inspector can use this to better describe
+        this scope in the frontend.
+
+        * debugger/DebuggerScope.cpp:
+        (JSC::DebuggerScope::isNestedLexicalScope):
+        * debugger/DebuggerScope.h:
+        * runtime/JSScope.cpp:
+        (JSC::JSScope::isNestedLexicalScope):
+        * runtime/JSScope.h:
+        * runtime/SymbolTable.cpp:
+        (JSC::SymbolTable::SymbolTable):
+        (JSC::SymbolTable::cloneScopePart):
+        * runtime/SymbolTable.h:
+        Access the isNestedLexicalScope bit.
+
+2015-12-17  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
</ins><span class="cx">         Unreviewed EFL Build Fix after r194247.
</span><span class="cx"> 
</span><span class="cx">         * interpreter/CallFrame.cpp:
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -809,7 +809,7 @@
</span><span class="cx">         }
</span><span class="cx">         
</span><span class="cx">         // This implements step 25 of section 9.2.12.
</span><del>-        pushLexicalScopeInternal(environment, true, nullptr, TDZRequirement::UnderTDZ, ScopeType::LetConstScope, ScopeRegisterType::Block);
</del><ins>+        pushLexicalScopeInternal(environment, true, false, nullptr, TDZRequirement::UnderTDZ, ScopeType::LetConstScope, ScopeRegisterType::Block);
</ins><span class="cx"> 
</span><span class="cx">         RefPtr&lt;RegisterID&gt; temp = newTemporary();
</span><span class="cx">         for (unsigned i = 0; i &lt; parameters.size(); i++) {
</span><span class="lines">@@ -927,7 +927,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     size_t size = m_symbolTableStack.size();
</span><del>-    pushLexicalScopeInternal(environment, true, nullptr, TDZRequirement::UnderTDZ, ScopeType::LetConstScope, ScopeRegisterType::Block);
</del><ins>+    pushLexicalScopeInternal(environment, true, false, nullptr, TDZRequirement::UnderTDZ, ScopeType::LetConstScope, ScopeRegisterType::Block);
</ins><span class="cx"> 
</span><span class="cx">     ASSERT_UNUSED(size, m_symbolTableStack.size() == size + 1);
</span><span class="cx"> 
</span><span class="lines">@@ -1797,13 +1797,13 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BytecodeGenerator::pushLexicalScope(VariableEnvironmentNode* node, bool canOptimizeTDZChecks, RegisterID** constantSymbolTableResult)
</del><ins>+void BytecodeGenerator::pushLexicalScope(VariableEnvironmentNode* node, bool canOptimizeTDZChecks, bool isNestedLexicalScope, RegisterID** constantSymbolTableResult)
</ins><span class="cx"> {
</span><span class="cx">     VariableEnvironment&amp; environment = node-&gt;lexicalVariables();
</span><del>-    pushLexicalScopeInternal(environment, canOptimizeTDZChecks, constantSymbolTableResult, TDZRequirement::UnderTDZ, ScopeType::LetConstScope, ScopeRegisterType::Block);
</del><ins>+    pushLexicalScopeInternal(environment, canOptimizeTDZChecks, isNestedLexicalScope, constantSymbolTableResult, TDZRequirement::UnderTDZ, ScopeType::LetConstScope, ScopeRegisterType::Block);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void BytecodeGenerator::pushLexicalScopeInternal(VariableEnvironment&amp; environment, bool canOptimizeTDZChecks, 
</del><ins>+void BytecodeGenerator::pushLexicalScopeInternal(VariableEnvironment&amp; environment, bool canOptimizeTDZChecks, bool isNestedLexicalScope,
</ins><span class="cx">     RegisterID** constantSymbolTableResult, TDZRequirement tdzRequirement, ScopeType scopeType, ScopeRegisterType scopeRegisterType)
</span><span class="cx"> {
</span><span class="cx">     if (!environment.size())
</span><span class="lines">@@ -1825,6 +1825,9 @@
</span><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    if (isNestedLexicalScope)
+        symbolTable-&gt;markIsNestedLexicalScope();
+
</ins><span class="cx">     auto lookUpVarKind = [] (UniquedStringImpl*, const VariableEnvironmentEntry&amp; entry) -&gt; VarKind {
</span><span class="cx">         return entry.isCaptured() ? VarKind::Scope : VarKind::Stack;
</span><span class="cx">     };
</span><span class="lines">@@ -3563,7 +3566,7 @@
</span><span class="cx">         addResult.iterator-&gt;value.setIsCaptured();
</span><span class="cx">     addResult.iterator-&gt;value.setIsConst(); // The function name scope name acts like a const variable.
</span><span class="cx">     unsigned numVars = m_codeBlock-&gt;m_numVars;
</span><del>-    pushLexicalScopeInternal(nameScopeEnvironment, true, nullptr, TDZRequirement::NotUnderTDZ, ScopeType::FunctionNameScope, ScopeRegisterType::Var);
</del><ins>+    pushLexicalScopeInternal(nameScopeEnvironment, true, false, nullptr, TDZRequirement::NotUnderTDZ, ScopeType::FunctionNameScope, ScopeRegisterType::Var);
</ins><span class="cx">     ASSERT_UNUSED(numVars, m_codeBlock-&gt;m_numVars == static_cast&lt;int&gt;(numVars + 1)); // Should have only created one new &quot;var&quot; for the function name scope.
</span><span class="cx">     bool shouldTreatAsLexicalVariable = isStrictMode();
</span><span class="cx">     Variable functionVar = variableForLocalEntry(property, m_symbolTableStack.last().m_symbolTable-&gt;get(property.impl()), m_symbolTableStack.last().m_symbolTableConstantIndex, shouldTreatAsLexicalVariable);
</span><span class="lines">@@ -3589,7 +3592,7 @@
</span><span class="cx"> void BytecodeGenerator::emitPushCatchScope(const Identifier&amp; property, RegisterID* exceptionValue, VariableEnvironment&amp; environment)
</span><span class="cx"> {
</span><span class="cx">     RELEASE_ASSERT(environment.contains(property.impl()));
</span><del>-    pushLexicalScopeInternal(environment, true, nullptr, TDZRequirement::NotUnderTDZ, ScopeType::CatchScope, ScopeRegisterType::Block);
</del><ins>+    pushLexicalScopeInternal(environment, true, false, nullptr, TDZRequirement::NotUnderTDZ, ScopeType::CatchScope, ScopeRegisterType::Block);
</ins><span class="cx">     Variable exceptionVar = variable(property);
</span><span class="cx">     RELEASE_ASSERT(exceptionVar.isResolved());
</span><span class="cx">     RefPtr&lt;RegisterID&gt; scope = emitResolveScope(nullptr, exceptionVar);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerBytecodeGeneratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -704,7 +704,7 @@
</span><span class="cx">         enum class TDZRequirement { UnderTDZ, NotUnderTDZ };
</span><span class="cx">         enum class ScopeType { CatchScope, LetConstScope, FunctionNameScope };
</span><span class="cx">         enum class ScopeRegisterType { Var, Block };
</span><del>-        void pushLexicalScopeInternal(VariableEnvironment&amp;, bool canOptimizeTDZChecks, RegisterID** constantSymbolTableResult, TDZRequirement, ScopeType, ScopeRegisterType);
</del><ins>+        void pushLexicalScopeInternal(VariableEnvironment&amp;, bool canOptimizeTDZChecks, bool isNestedLexicalScope, RegisterID** constantSymbolTableResult, TDZRequirement, ScopeType, ScopeRegisterType);
</ins><span class="cx">         void popLexicalScopeInternal(VariableEnvironment&amp;, TDZRequirement);
</span><span class="cx">         template&lt;typename LookUpVarKindFunctor&gt;
</span><span class="cx">         bool instantiateLexicalVariables(const VariableEnvironment&amp;, SymbolTable*, ScopeRegisterType, LookUpVarKindFunctor);
</span><span class="lines">@@ -715,7 +715,7 @@
</span><span class="cx">         void emitNewFunctionExpressionCommon(RegisterID*, BaseFuncExprNode*);
</span><span class="cx"> 
</span><span class="cx">     public:
</span><del>-        void pushLexicalScope(VariableEnvironmentNode*, bool canOptimizeTDZChecks, RegisterID** constantSymbolTableResult = nullptr);
</del><ins>+        void pushLexicalScope(VariableEnvironmentNode*, bool canOptimizeTDZChecks, bool isNestedLexicalScope = false, RegisterID** constantSymbolTableResult = nullptr);
</ins><span class="cx">         void popLexicalScope(VariableEnvironmentNode*);
</span><span class="cx">         void prepareLexicalScopeForNextForLoopIteration(VariableEnvironmentNode*, RegisterID* loopSymbolTable);
</span><span class="cx">         int labelScopeDepth() const;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebytecompilerNodesCodegencpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/Source/JavaScriptCore/bytecompiler/NodesCodegen.cpp        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -2049,7 +2049,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (!m_statements)
</span><span class="cx">         return;
</span><del>-    generator.pushLexicalScope(this, true);
</del><ins>+    generator.pushLexicalScope(this, true, true);
</ins><span class="cx">     m_statements-&gt;emitBytecode(generator, dst);
</span><span class="cx">     generator.popLexicalScope(this);
</span><span class="cx"> }
</span><span class="lines">@@ -2254,7 +2254,7 @@
</span><span class="cx">     LabelScopePtr scope = generator.newLabelScope(LabelScope::Loop);
</span><span class="cx"> 
</span><span class="cx">     RegisterID* forLoopSymbolTable = nullptr;
</span><del>-    generator.pushLexicalScope(this, true, &amp;forLoopSymbolTable);
</del><ins>+    generator.pushLexicalScope(this, true, true, &amp;forLoopSymbolTable);
</ins><span class="cx"> 
</span><span class="cx">     generator.emitDebugHook(WillExecuteStatement, firstLine(), startOffset(), lineStartOffset());
</span><span class="cx"> 
</span><span class="lines">@@ -2382,7 +2382,7 @@
</span><span class="cx">     RefPtr&lt;Label&gt; end = generator.newLabel();
</span><span class="cx"> 
</span><span class="cx">     RegisterID* forLoopSymbolTable = nullptr;
</span><del>-    generator.pushLexicalScope(this, true, &amp;forLoopSymbolTable);
</del><ins>+    generator.pushLexicalScope(this, true, true, &amp;forLoopSymbolTable);
</ins><span class="cx"> 
</span><span class="cx">     generator.emitDebugHook(WillExecuteStatement, firstLine(), startOffset(), lineStartOffset());
</span><span class="cx"> 
</span><span class="lines">@@ -2532,7 +2532,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     RegisterID* forLoopSymbolTable = nullptr;
</span><del>-    generator.pushLexicalScope(this, true, &amp;forLoopSymbolTable);
</del><ins>+    generator.pushLexicalScope(this, true, true, &amp;forLoopSymbolTable);
</ins><span class="cx">     generator.emitDebugHook(WillExecuteStatement, firstLine(), startOffset(), lineStartOffset());
</span><span class="cx">     auto extractor = [this, dst](BytecodeGenerator&amp; generator, RegisterID* value)
</span><span class="cx">     {
</span><span class="lines">@@ -2848,7 +2848,7 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;RegisterID&gt; r0 = generator.emitNode(m_expr);
</span><span class="cx"> 
</span><del>-    generator.pushLexicalScope(this, false);
</del><ins>+    generator.pushLexicalScope(this, false, true);
</ins><span class="cx">     m_block-&gt;emitBytecodeForBlock(generator, r0.get(), dst);
</span><span class="cx">     generator.popLexicalScope(this);
</span><span class="cx"> 
</span><span class="lines">@@ -3181,7 +3181,7 @@
</span><span class="cx"> RegisterID* ClassExprNode::emitBytecode(BytecodeGenerator&amp; generator, RegisterID* dst)
</span><span class="cx"> {
</span><span class="cx">     if (!m_name.isNull())
</span><del>-        generator.pushLexicalScope(this, true);
</del><ins>+        generator.pushLexicalScope(this, true, true);
</ins><span class="cx"> 
</span><span class="cx">     RefPtr&lt;RegisterID&gt; superclass;
</span><span class="cx">     if (m_classHeritage) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggerScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/DebuggerScope.cpp (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/DebuggerScope.cpp        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/Source/JavaScriptCore/debugger/DebuggerScope.cpp        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -197,6 +197,11 @@
</span><span class="cx">     return m_scope-&gt;isVarScope() || m_scope-&gt;isLexicalScope();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool DebuggerScope::isNestedLexicalScope() const
+{
+    return m_scope-&gt;isNestedLexicalScope();
+}
+
</ins><span class="cx"> JSValue DebuggerScope::caughtValue(ExecState* exec) const
</span><span class="cx"> {
</span><span class="cx">     ASSERT(isCatchScope());
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggerScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/DebuggerScope.h (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/DebuggerScope.h        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/Source/JavaScriptCore/debugger/DebuggerScope.h        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -91,6 +91,7 @@
</span><span class="cx">     bool isGlobalScope() const;
</span><span class="cx">     bool isClosureScope() const;
</span><span class="cx">     bool isGlobalLexicalEnvironment() const;
</span><ins>+    bool isNestedLexicalScope() const;
</ins><span class="cx"> 
</span><span class="cx">     JSValue caughtValue(ExecState*) const;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInjectedScriptSourcejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -1369,6 +1369,7 @@
</span><span class="cx">     4: &quot;catch&quot;, // CATCH_SCOPE
</span><span class="cx">     5: &quot;functionName&quot;, // FUNCTION_NAME_SCOPE
</span><span class="cx">     6: &quot;globalLexicalEnvironment&quot;, // GLOBAL_LEXICAL_ENVIRONMENT_SCOPE
</span><ins>+    7: &quot;nestedLexical&quot;, // NESTED_LEXICAL_SCOPE
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> InjectedScript.CallFrameProxy._createScopeJson = function(scopeTypeCode, scopeObject, groupId)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSJavaScriptCallFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -95,17 +95,9 @@
</span><span class="cx">     DebuggerScope* scopeChain = impl().scopeChain();
</span><span class="cx">     DebuggerScope::iterator end = scopeChain-&gt;end();
</span><span class="cx"> 
</span><del>-    bool foundLocalScope = false;
</del><span class="cx">     for (DebuggerScope::iterator iter = scopeChain-&gt;begin(); iter != end; ++iter) {
</span><span class="cx">         DebuggerScope* scope = iter.get();
</span><span class="cx"> 
</span><del>-        if (!foundLocalScope &amp;&amp; scope-&gt;isClosureScope()) {
-            // First closure scope is the local scope, each successive one is a true closure.
-            if (!index)
-                return jsNumber(JSJavaScriptCallFrame::LOCAL_SCOPE);
-            foundLocalScope = true;
-        }
-
</del><span class="cx">         if (!index) {
</span><span class="cx">             if (scope-&gt;isCatchScope())
</span><span class="cx">                 return jsNumber(JSJavaScriptCallFrame::CATCH_SCOPE);
</span><span class="lines">@@ -113,6 +105,8 @@
</span><span class="cx">                 return jsNumber(JSJavaScriptCallFrame::FUNCTION_NAME_SCOPE);
</span><span class="cx">             if (scope-&gt;isWithScope())
</span><span class="cx">                 return jsNumber(JSJavaScriptCallFrame::WITH_SCOPE);
</span><ins>+            if (scope-&gt;isNestedLexicalScope())
+                return jsNumber(JSJavaScriptCallFrame::NESTED_LEXICAL_SCOPE);
</ins><span class="cx">             if (scope-&gt;isGlobalLexicalEnvironment())
</span><span class="cx">                 return jsNumber(JSJavaScriptCallFrame::GLOBAL_LEXICAL_ENVIRONMENT_SCOPE);
</span><span class="cx">             if (scope-&gt;isGlobalScope()) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSJavaScriptCallFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.h (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.h        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.h        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -78,6 +78,7 @@
</span><span class="cx">     static const unsigned short CATCH_SCOPE = 4;
</span><span class="cx">     static const unsigned short FUNCTION_NAME_SCOPE = 5;
</span><span class="cx">     static const unsigned short GLOBAL_LEXICAL_ENVIRONMENT_SCOPE = 6;
</span><ins>+    static const unsigned short NESTED_LEXICAL_SCOPE = 7;
</ins><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     void finishCreation(JSC::VM&amp;);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorprotocolDebuggerjson"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/protocol/Debugger.json (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/protocol/Debugger.json        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/Source/JavaScriptCore/inspector/protocol/Debugger.json        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx">             &quot;id&quot;: &quot;Scope&quot;,
</span><span class="cx">             &quot;type&quot;: &quot;object&quot;,
</span><span class="cx">             &quot;properties&quot;: [
</span><del>-                { &quot;name&quot;: &quot;type&quot;, &quot;type&quot;: &quot;string&quot;, &quot;enum&quot;: [&quot;global&quot;, &quot;local&quot;, &quot;with&quot;, &quot;closure&quot;, &quot;catch&quot;, &quot;functionName&quot;, &quot;globalLexicalEnvironment&quot;], &quot;description&quot;: &quot;Scope type.&quot; },
</del><ins>+                { &quot;name&quot;: &quot;type&quot;, &quot;type&quot;: &quot;string&quot;, &quot;enum&quot;: [&quot;global&quot;, &quot;local&quot;, &quot;with&quot;, &quot;closure&quot;, &quot;catch&quot;, &quot;functionName&quot;, &quot;globalLexicalEnvironment&quot;, &quot;nestedLexical&quot;], &quot;description&quot;: &quot;Scope type.&quot; },
</ins><span class="cx">                 { &quot;name&quot;: &quot;object&quot;, &quot;$ref&quot;: &quot;Runtime.RemoteObject&quot;, &quot;description&quot;: &quot;Object representing the scope. For &lt;code&gt;global&lt;/code&gt; and &lt;code&gt;with&lt;/code&gt; scopes it represents the actual object; for the rest of the scopes, it is artificial transient object enumerating scope variables as its properties.&quot; }
</span><span class="cx">             ],
</span><span class="cx">             &quot;description&quot;: &quot;Scope description.&quot;
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSScopecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSScope.cpp (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSScope.cpp        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/Source/JavaScriptCore/runtime/JSScope.cpp        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -286,6 +286,13 @@
</span><span class="cx">     return isScopeType&lt;JSGlobalLexicalEnvironment, SymbolTable::ScopeType::GlobalLexicalScope&gt;(this);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool JSScope::isNestedLexicalScope()
+{
+    if (JSLexicalEnvironment* environment = jsDynamicCast&lt;JSLexicalEnvironment*&gt;(this))
+        return environment-&gt;symbolTable()-&gt;isNestedLexicalScope();
+    return false;
+}
+
</ins><span class="cx"> JSScope* JSScope::constantScopeForCodeBlock(ResolveType type, CodeBlock* codeBlock)
</span><span class="cx"> {
</span><span class="cx">     switch (type) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSScopeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSScope.h (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSScope.h        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/Source/JavaScriptCore/runtime/JSScope.h        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -62,6 +62,8 @@
</span><span class="cx">     bool isCatchScope();
</span><span class="cx">     bool isFunctionNameScopeObject();
</span><span class="cx"> 
</span><ins>+    bool isNestedLexicalScope();
+
</ins><span class="cx">     ScopeChainIterator begin();
</span><span class="cx">     ScopeChainIterator end();
</span><span class="cx">     JSScope* next();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeSymbolTablecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/SymbolTable.cpp (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/SymbolTable.cpp        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/Source/JavaScriptCore/runtime/SymbolTable.cpp        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -84,6 +84,7 @@
</span><span class="cx"> SymbolTable::SymbolTable(VM&amp; vm)
</span><span class="cx">     : JSCell(vm, vm.symbolTableStructure.get())
</span><span class="cx">     , m_usesNonStrictEval(false)
</span><ins>+    , m_nestedLexicalScope(false)
</ins><span class="cx">     , m_scopeType(VarScope)
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="lines">@@ -142,6 +143,7 @@
</span><span class="cx">     SymbolTable* result = SymbolTable::create(vm);
</span><span class="cx">     
</span><span class="cx">     result-&gt;m_usesNonStrictEval = m_usesNonStrictEval;
</span><ins>+    result-&gt;m_nestedLexicalScope = m_nestedLexicalScope;
</ins><span class="cx">     result-&gt;m_scopeType = m_scopeType;
</span><span class="cx"> 
</span><span class="cx">     for (auto iter = m_map.begin(), end = m_map.end(); iter != end; ++iter) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeSymbolTableh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/SymbolTable.h (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/SymbolTable.h        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/Source/JavaScriptCore/runtime/SymbolTable.h        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -646,9 +646,12 @@
</span><span class="cx">     RefPtr&lt;TypeSet&gt; globalTypeSetForOffset(const ConcurrentJITLocker&amp;, VarOffset, VM&amp;);
</span><span class="cx">     RefPtr&lt;TypeSet&gt; globalTypeSetForVariable(const ConcurrentJITLocker&amp;, UniquedStringImpl* key, VM&amp;);
</span><span class="cx"> 
</span><del>-    bool usesNonStrictEval() { return m_usesNonStrictEval; }
</del><ins>+    bool usesNonStrictEval() const { return m_usesNonStrictEval; }
</ins><span class="cx">     void setUsesNonStrictEval(bool usesNonStrictEval) { m_usesNonStrictEval = usesNonStrictEval; }
</span><span class="cx"> 
</span><ins>+    bool isNestedLexicalScope() const { return m_nestedLexicalScope; }
+    void markIsNestedLexicalScope() { ASSERT(scopeType() == LexicalScope); m_nestedLexicalScope = true; }
+
</ins><span class="cx">     enum ScopeType {
</span><span class="cx">         VarScope,
</span><span class="cx">         GlobalLexicalScope,
</span><span class="lines">@@ -686,6 +689,7 @@
</span><span class="cx">     std::unique_ptr&lt;TypeProfilingRareData&gt; m_typeProfilingRareData;
</span><span class="cx"> 
</span><span class="cx">     bool m_usesNonStrictEval : 1;
</span><ins>+    bool m_nestedLexicalScope : 1; // Non-function LexicalScope.
</ins><span class="cx">     unsigned m_scopeType : 3; // ScopeType
</span><span class="cx">     
</span><span class="cx">     WriteBarrier&lt;ScopedArgumentsTable&gt; m_arguments;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/ChangeLog (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/ChangeLog        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/Source/WebInspectorUI/ChangeLog        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -1,5 +1,24 @@
</span><span class="cx"> 2015-12-17  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Provide a way to distinguish a nested lexical block from a function's lexical block
+        https://bugs.webkit.org/show_bug.cgi?id=152361
+
+        Reviewed by Saam Barati.
+
+        * Localizations/en.lproj/localizedStrings.js:
+        * UserInterface/Views/ScopeChainDetailsSidebarPanel.js:
+        (WebInspector.ScopeChainDetailsSidebarPanel.prototype._generateCallFramesSection):
+        New &quot;Block Variables&quot; string.
+
+        * UserInterface/Models/ScopeChainNode.js:
+        New &quot;Block&quot; scope type, and update existing types.
+
+        * UserInterface/Controllers/DebuggerManager.js:
+        (WebInspector.DebuggerManager.prototype._scopeChainNodeFromPayload):
+        Parse the protocol type to frontend types. Use the protocol generated enum.
+
+2015-12-17  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
</ins><span class="cx">         Web Inspector: Improve names in Debugger Call Stack section when paused
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=152398
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebInspectorUILocalizationsenlprojlocalizedStringsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/Source/WebInspectorUI/Localizations/en.lproj/localizedStrings.js        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -95,6 +95,7 @@
</span><span class="cx"> localizedStrings[&quot;Background&quot;] = &quot;Background&quot;;
</span><span class="cx"> localizedStrings[&quot;Basis&quot;] = &quot;Basis&quot;;
</span><span class="cx"> localizedStrings[&quot;Begin Capturing&quot;] = &quot;Begin Capturing&quot;;
</span><ins>+localizedStrings[&quot;Block Variables&quot;] = &quot;Block Variables&quot;;
</ins><span class="cx"> localizedStrings[&quot;Blur&quot;] = &quot;Blur&quot;;
</span><span class="cx"> localizedStrings[&quot;Border&quot;] = &quot;Border&quot;;
</span><span class="cx"> localizedStrings[&quot;Bottom&quot;] = &quot;Bottom&quot;;
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceControllersDebuggerManagerjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/Source/WebInspectorUI/UserInterface/Controllers/DebuggerManager.js        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -585,25 +585,28 @@
</span><span class="cx">     {
</span><span class="cx">         var type = null;
</span><span class="cx">         switch (payload.type) {
</span><del>-        case &quot;local&quot;:
</del><ins>+        case DebuggerAgent.ScopeType.Local:
</ins><span class="cx">             type = WebInspector.ScopeChainNode.Type.Local;
</span><span class="cx">             break;
</span><del>-        case &quot;global&quot;:
</del><ins>+        case DebuggerAgent.ScopeType.Global:
</ins><span class="cx">             type = WebInspector.ScopeChainNode.Type.Global;
</span><span class="cx">             break;
</span><del>-        case &quot;with&quot;:
</del><ins>+        case DebuggerAgent.ScopeType.With:
</ins><span class="cx">             type = WebInspector.ScopeChainNode.Type.With;
</span><span class="cx">             break;
</span><del>-        case &quot;closure&quot;:
</del><ins>+        case DebuggerAgent.ScopeType.Closure:
</ins><span class="cx">             type = WebInspector.ScopeChainNode.Type.Closure;
</span><span class="cx">             break;
</span><del>-        case &quot;catch&quot;:
</del><ins>+        case DebuggerAgent.ScopeType.Catch:
</ins><span class="cx">             type = WebInspector.ScopeChainNode.Type.Catch;
</span><span class="cx">             break;
</span><del>-        case &quot;functionName&quot;:
</del><ins>+        case DebuggerAgent.ScopeType.FunctionName:
</ins><span class="cx">             type = WebInspector.ScopeChainNode.Type.FunctionName;
</span><span class="cx">             break;
</span><del>-        case &quot;globalLexicalEnvironment&quot;:
</del><ins>+        case DebuggerAgent.ScopeType.NestedLexical:
+            type = WebInspector.ScopeChainNode.Type.Block;
+            break;
+        case DebuggerAgent.ScopeType.GlobalLexicalEnvironment:
</ins><span class="cx">             type = WebInspector.ScopeChainNode.Type.GlobalLexicalEnvironment;
</span><span class="cx">             break;
</span><span class="cx">         default:
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceModelsScopeChainNodejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Models/ScopeChainNode.js (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Models/ScopeChainNode.js        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/Source/WebInspectorUI/UserInterface/Models/ScopeChainNode.js        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -55,9 +55,10 @@
</span><span class="cx"> WebInspector.ScopeChainNode.Type = {
</span><span class="cx">     Local: &quot;scope-chain-type-local&quot;,
</span><span class="cx">     Global: &quot;scope-chain-type-global&quot;,
</span><ins>+    GlobalLexicalEnvironment: &quot;scope-chain-type-global-lexical-environment&quot;,
</ins><span class="cx">     With: &quot;scope-chain-type-with&quot;,
</span><span class="cx">     Closure: &quot;scope-chain-type-closure&quot;,
</span><span class="cx">     Catch: &quot;scope-chain-type-catch&quot;,
</span><del>-    FunctionName: &quot;scope-chain-type-functionName&quot;,
-    GlobalLexicalEnvironment: &quot;scope-chain-type-globalLexicalEnvironment&quot;,
</del><ins>+    FunctionName: &quot;scope-chain-type-function-name&quot;,
+    Block: &quot;scope-chain-type-block&quot;,
</ins><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebInspectorUIUserInterfaceViewsScopeChainDetailsSidebarPaneljs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js (194250 => 194251)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js        2015-12-18 01:09:00 UTC (rev 194250)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/ScopeChainDetailsSidebarPanel.js        2015-12-18 01:09:13 UTC (rev 194251)
</span><span class="lines">@@ -184,6 +184,11 @@
</span><span class="cx">                         extraPropertyDescriptor = new WebInspector.PropertyDescriptor({name: &quot;this&quot;, value: callFrame.thisObject});
</span><span class="cx">                     break;
</span><span class="cx"> 
</span><ins>+                case WebInspector.ScopeChainNode.Type.Block:
+                    title = WebInspector.UIString(&quot;Block Variables&quot;);
+                    collapsedByDefault = false;
+                    break;
+
</ins><span class="cx">                 case WebInspector.ScopeChainNode.Type.Closure:
</span><span class="cx">                     title = WebInspector.UIString(&quot;Closure Variables&quot;);
</span><span class="cx">                     collapsedByDefault = false;
</span></span></pre>
</div>
</div>

</body>
</html>