<!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>[200634] 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/200634">200634</a></dd>
<dt>Author</dt> <dd>joepeck@webkit.org</dd>
<dt>Date</dt> <dd>2016-05-10 12:16:19 -0700 (Tue, 10 May 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Web Inspector: Eliminate the crazy code for evaluateOnCallFrame
https://bugs.webkit.org/show_bug.cgi?id=157510
&lt;rdar://problem/26191332&gt;

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::evaluateWithScopeExtension):
Set and clear an optional scope extension object.

* inspector/InjectedScriptSource.js:
(InjectedScript.prototype.evaluate):
(InjectedScript.prototype._evaluateOn):
(InjectedScript.prototype.evaluateOnCallFrame):
Unify the code to use the passed in evaluate function and object.
When evaluating on a call frame the evaluate function ends up being
DebuggerCallFrame::evaluateWithScopeExtension. When evaluating globally
this ends up being JSInjectedScriptHost::evaluateWithScopeExtension.
In both cases &quot;object&quot; is the preferred this object to use.

* debugger/DebuggerCallFrame.h:
* inspector/JSJavaScriptCallFrame.cpp:
(Inspector::JSJavaScriptCallFrame::evaluateWithScopeExtension):
(Inspector::JSJavaScriptCallFrame::evaluate): Deleted.
* inspector/JSJavaScriptCallFrame.h:
* inspector/JSJavaScriptCallFramePrototype.cpp:
(Inspector::JSJavaScriptCallFramePrototype::finishCreation):
(Inspector::jsJavaScriptCallFramePrototypeFunctionEvaluateWithScopeExtension):
* inspector/JavaScriptCallFrame.h:
(Inspector::JavaScriptCallFrame::evaluateWithScopeExtension):
(Inspector::JavaScriptCallFrame::evaluate): Deleted.
Pass through to DebuggerCallFrame with the proper arguments.

* debugger/Debugger.cpp:
(JSC::Debugger::hasBreakpoint):
* inspector/ScriptDebugServer.cpp:
(Inspector::ScriptDebugServer::evaluateBreakpointAction):
Use the new evaluate on call frame method name and no scope extension object.

LayoutTests:

* inspector/debugger/evaluateOnCallFrame-CommandLineAPI-expected.txt: Added.
* inspector/debugger/evaluateOnCallFrame-CommandLineAPI.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoredebuggerDebuggercpp">trunk/Source/JavaScriptCore/debugger/Debugger.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredebuggerDebuggerCallFramecpp">trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoredebuggerDebuggerCallFrameh">trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.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="#trunkSourceJavaScriptCoreinspectorJSJavaScriptCallFramePrototypecpp">trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFramePrototype.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorJavaScriptCallFrameh">trunk/Source/JavaScriptCore/inspector/JavaScriptCallFrame.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreinspectorScriptDebugServercpp">trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsinspectordebuggerevaluateOnCallFrameCommandLineAPIexpectedtxt">trunk/LayoutTests/inspector/debugger/evaluateOnCallFrame-CommandLineAPI-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectordebuggerevaluateOnCallFrameCommandLineAPIhtml">trunk/LayoutTests/inspector/debugger/evaluateOnCallFrame-CommandLineAPI.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (200633 => 200634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-05-10 19:08:27 UTC (rev 200633)
+++ trunk/LayoutTests/ChangeLog        2016-05-10 19:16:19 UTC (rev 200634)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-05-10  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Eliminate the crazy code for evaluateOnCallFrame
+        https://bugs.webkit.org/show_bug.cgi?id=157510
+        &lt;rdar://problem/26191332&gt;
+
+        Reviewed by Timothy Hatcher.
+
+        * inspector/debugger/evaluateOnCallFrame-CommandLineAPI-expected.txt: Added.
+        * inspector/debugger/evaluateOnCallFrame-CommandLineAPI.html: Added.
+
</ins><span class="cx"> 2016-05-05  Jer Noble  &lt;jer.noble@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Return a Promise from HTMLMediaElement.play()
</span></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerevaluateOnCallFrameCommandLineAPIexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/evaluateOnCallFrame-CommandLineAPI-expected.txt (0 => 200634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/evaluateOnCallFrame-CommandLineAPI-expected.txt                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/evaluateOnCallFrame-CommandLineAPI-expected.txt        2016-05-10 19:16:19 UTC (rev 200634)
</span><span class="lines">@@ -0,0 +1,56 @@
</span><ins>+Tests for the Debugger.evaluateOnCallFrame with the Command Line API.
+
+
+== Running test suite: Debugger.evaluateOnCallFrame.CommandLineAPI
+-- Running test case: ValidateCallFrames
+PASS: Strict call frame is `bar`.
+PASS: Non-strict call frame is `foo`.
+PASS: `a` should be 5 in `bar`.
+PASS: `b` should be 123 in `bar`.
+PASS: `c` should be 0 in `bar`.
+PASS: `this` should be undefined in `bar`.
+PASS: `a` should be 1 in `foo`.
+PASS: `b` should be 2 in `foo`.
+PASS: `c` should be 6 in `foo`.
+PASS: `this` should be 'my-this-object' in `foo`.
+
+-- Running test case: AccessCommandLineAPI
+PASS: CommandLineAPI `keys` can be accessed in the `bar` strict call frame.
+PASS: CommandLineAPI `keys` can be accessed in the `foo` non-strict call frame.
+PASS: CommandLineAPI `keys` should work with a simple object.
+
+-- Running test case: AccessGlobalVariable
+PASS: Should be able to access var in global scope in strict call frame.
+PASS: Should be able to access let in global scope in strict call frame.
+PASS: Should be able to access const in global scope in strict call frame.
+PASS: Should be able to access var in global scope in non-strict call frame.
+PASS: Should be able to access let in global scope in non-strict call frame.
+PASS: Should be able to access const in global scope in non-strict call frame.
+
+-- Running test case: NoVariablesCreatedOnCallFrame
+PASS: Should not be able to access local var created in earlier eval on strict call frame.
+PASS: Should not be able to access local let created in earlier eval on strict call frame.
+PASS: Should not be able to access local const created in earlier eval on strict call frame.
+PASS: Should be able to access local var created in earlier eval on non-strict call frame.
+PASS: Should not be able to access local let created in earlier eval on non-strict call frame.
+PASS: Should not be able to access local const created in earlier eval on non-strict call frame.
+
+-- Running test case: NonStrictAndStrictEvaluations
+PASS: Non-strict evaluation. Should be able to access arguments.callee.
+PASS: Strict evaluation. Should not be able to access arguments.callee.
+
+-- Running test case: CommandLineAPIDoesNotShadowLocalVariables
+PASS: Local variable `keys` should not be shadowed by CommandLineAPI `keys` function in call frame for `foo`.
+
+-- Running test case: CommandLineAPIDoesNotShadowGlobalVariables
+PASS: CommandLineAPI `keys` can be accessed in the `bar` strict call frame.
+PASS: Global assignment to `keys` should be okay.
+PASS: Global variable `keys` should not be shadowed by CommandLineAPI `keys` function in call frame for `bar`.
+PASS: CommandLineAPI `keys` can be accessed in the `bar` strict call frame after deleting global variable `keys`.
+
+-- Running test case: CommandLineAPIDoesNotShadowGlobalObjectProperties
+PASS: `values` should be `window.values` and not shadowed by CommandLineAPI `values` function in strict call frame.
+PASS: `values` should be `window.values` and not shadowed by CommandLineAPI `values` function in non-strict call frame.
+
+-- Running test case: Complete
+
</ins></span></pre></div>
<a id="trunkLayoutTestsinspectordebuggerevaluateOnCallFrameCommandLineAPIhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/inspector/debugger/evaluateOnCallFrame-CommandLineAPI.html (0 => 200634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/debugger/evaluateOnCallFrame-CommandLineAPI.html                                (rev 0)
+++ trunk/LayoutTests/inspector/debugger/evaluateOnCallFrame-CommandLineAPI.html        2016-05-10 19:16:19 UTC (rev 200634)
</span><span class="lines">@@ -0,0 +1,230 @@
</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&gt;
+var varGlobalVariable = 1;
+let letGlobalVariable = 2;
+const constGlobalVariable = 3;
+
+function foo(a, b) {
+    var c = a + b + arguments[2];
+    var keys = 123;
+    bar(c, keys, -129);
+}
+
+function bar(a, b) {
+    &quot;use strict&quot;;
+    let c = b + a + arguments[2];
+    debugger;
+    return c;
+}
+
+function triggerPause() {
+    foo.call(&quot;my-this-object&quot;, 1, 2, 3);
+}
+
+function test()
+{
+    const objectGroup = &quot;test&quot;;
+    const includeCommandLineAPI = true;
+    const returnByValue = true;
+
+    function testEvaluateOnCallFrame(callFrame, expression, callback) {
+        let callFrameId = callFrame.id;
+        DebuggerAgent.evaluateOnCallFrame.invoke({callFrameId, expression, objectGroup, includeCommandLineAPI, returnByValue}, (error, resultValue, wasThrown) =&gt; {
+            InspectorTest.assert(!error, &quot;Should not be a protocol error.&quot;);
+            InspectorTest.assert(!wasThrown, &quot;Should not be a runtime error.&quot;);
+            if (callback)
+                callback(resultValue.value);
+        });
+    }
+
+    function testEvaluateOnCallFrameThrows(callFrame, expression, callback) {
+        let callFrameId = callFrame.id;
+        DebuggerAgent.evaluateOnCallFrame.invoke({callFrameId, expression, objectGroup, includeCommandLineAPI, returnByValue}, (error, resultValue, wasThrown) =&gt; {
+            InspectorTest.assert(!error, &quot;Should not be a protocol error.&quot;);
+            InspectorTest.assert(wasThrown, &quot;Should be a runtime error.&quot;);
+            if (callback)
+                callback(wasThrown);
+        });
+    }
+
+    function testEvaluateOnStrictCallFrame(expression, callback) {
+        let callFrame = WebInspector.debuggerManager.activeCallFrame; // bar
+        testEvaluateOnCallFrame(callFrame, expression, callback);
+    }
+
+    function testEvaluateOnStrictCallFrameThrows(expression, callback) {
+        let callFrame = WebInspector.debuggerManager.activeCallFrame; // bar
+        testEvaluateOnCallFrameThrows(callFrame, expression, callback);
+    }
+
+    function testEvaluateOnNonStrictCallFrame(expression, callback) {
+        let callFrame = WebInspector.debuggerManager.callFrames[1]; // foo
+        testEvaluateOnCallFrame(callFrame, expression, callback);
+    }
+
+    function testEvaluateOnNonStrictCallFrameThrows(expression, callback) {
+        let callFrame = WebInspector.debuggerManager.callFrames[1]; // foo
+        testEvaluateOnCallFrameThrows(callFrame, expression, callback);
+    }
+
+    let suite = InspectorTest.createAsyncSuite(&quot;Debugger.evaluateOnCallFrame.CommandLineAPI&quot;);
+
+    suite.addTestCase({
+        name: &quot;ValidateCallFrames&quot;,
+        description: &quot;Test6 evaluate can access CommandLineAPI methods.&quot;,
+        test: (resolve, reject) =&gt; {
+            InspectorTest.expectThat(WebInspector.debuggerManager.activeCallFrame.functionName === &quot;bar&quot;, &quot;Strict call frame is `bar`.&quot;);
+            InspectorTest.expectThat(WebInspector.debuggerManager.callFrames[1].functionName === &quot;foo&quot;, &quot;Non-strict call frame is `foo`.&quot;);
+
+            testEvaluateOnStrictCallFrame(&quot;a&quot;, (x) =&gt; { InspectorTest.expectThat(x === 6, &quot;`a` should be 5 in `bar`.&quot;); });
+            testEvaluateOnStrictCallFrame(&quot;b&quot;, (x) =&gt; { InspectorTest.expectThat(x === 123, &quot;`b` should be 123 in `bar`.&quot;); });
+            testEvaluateOnStrictCallFrame(&quot;c&quot;, (x) =&gt; { InspectorTest.expectThat(x === 0, &quot;`c` should be 0 in `bar`.&quot;); });
+            testEvaluateOnStrictCallFrame(&quot;this&quot;, (x) =&gt; { InspectorTest.expectThat(x === undefined, &quot;`this` should be undefined in `bar`.&quot;); });
+
+            testEvaluateOnNonStrictCallFrame(&quot;a&quot;, (x) =&gt; { InspectorTest.expectThat(x === 1, &quot;`a` should be 1 in `foo`.&quot;); });
+            testEvaluateOnNonStrictCallFrame(&quot;b&quot;, (x) =&gt; { InspectorTest.expectThat(x === 2, &quot;`b` should be 2 in `foo`.&quot;); });
+            testEvaluateOnNonStrictCallFrame(&quot;c&quot;, (x) =&gt; { InspectorTest.expectThat(x === 6, &quot;`c` should be 6 in `foo`.&quot;); });
+            testEvaluateOnNonStrictCallFrame(&quot;this.toString()&quot;, (x) =&gt; { InspectorTest.expectThat(x === &quot;my-this-object&quot;, &quot;`this` should be 'my-this-object' in `foo`.&quot;); resolve(); });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;AccessCommandLineAPI&quot;,
+        description: &quot;Test evaluate can access CommandLineAPI methods.&quot;,
+        test: (resolve, reject) =&gt; {
+            testEvaluateOnStrictCallFrame(&quot;keys.toString()&quot;, (resultValue) =&gt; {
+                InspectorTest.expectThat(resultValue.includes(&quot;[Command Line API]&quot;), &quot;CommandLineAPI `keys` can be accessed in the `bar` strict call frame.&quot;);
+            });
+            testEvaluateOnNonStrictCallFrame(&quot;dir.toString()&quot;, (resultValue) =&gt; {
+                InspectorTest.expectThat(resultValue.includes(&quot;[Command Line API]&quot;), &quot;CommandLineAPI `keys` can be accessed in the `foo` non-strict call frame.&quot;);
+            });
+            testEvaluateOnStrictCallFrame(&quot;keys({a:1, b:2})&quot;, (resultValue) =&gt; {
+                InspectorTest.expectThat(resultValue.length === 2 &amp;&amp; resultValue[0] === &quot;a&quot; &amp;&amp; resultValue[1] === &quot;b&quot;, &quot;CommandLineAPI `keys` should work with a simple object.&quot;);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;AccessGlobalVariable&quot;,
+        description: &quot;Test evaluate can access global variables.&quot;,
+        test: (resolve, reject) =&gt; {
+            testEvaluateOnStrictCallFrame(&quot;varGlobalVariable&quot;, (x) =&gt; { InspectorTest.expectThat(x === 1, &quot;Should be able to access var in global scope in strict call frame.&quot;); });
+            testEvaluateOnStrictCallFrame(&quot;letGlobalVariable&quot;, (x) =&gt; { InspectorTest.expectThat(x === 2, &quot;Should be able to access let in global scope in strict call frame.&quot;); });
+            testEvaluateOnStrictCallFrame(&quot;constGlobalVariable&quot;, (x) =&gt; { InspectorTest.expectThat(x === 3, &quot;Should be able to access const in global scope in strict call frame.&quot;); });
+
+            testEvaluateOnNonStrictCallFrame(&quot;varGlobalVariable&quot;, (x) =&gt; { InspectorTest.expectThat(x === 1, &quot;Should be able to access var in global scope in non-strict call frame.&quot;); });
+            testEvaluateOnNonStrictCallFrame(&quot;letGlobalVariable&quot;, (x) =&gt; { InspectorTest.expectThat(x === 2, &quot;Should be able to access let in global scope in non-strict call frame.&quot;); });
+            testEvaluateOnNonStrictCallFrame(&quot;constGlobalVariable&quot;, (x) =&gt; { InspectorTest.expectThat(x === 3, &quot;Should be able to access const in global scope in non-strict call frame.&quot;); resolve(); });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;NoVariablesCreatedOnCallFrame&quot;,
+        description: &quot;Test evaluate may not create new local variables.&quot;,
+        test: (resolve, reject) =&gt; {
+            testEvaluateOnStrictCallFrame(`
+                var createdVarLocalVariable = 1;
+                let createdLetLocalVariable = 2;
+                const createdConstLocalVariable = 3;
+            `);
+            testEvaluateOnStrictCallFrameThrows(&quot;createdVarLocalVariable&quot;, (wasThrown) =&gt; { InspectorTest.expectThat(wasThrown, &quot;Should not be able to access local var created in earlier eval on strict call frame.&quot;); });
+            testEvaluateOnStrictCallFrameThrows(&quot;createdLetLocalVariable&quot;, (wasThrown) =&gt; { InspectorTest.expectThat(wasThrown, &quot;Should not be able to access local let created in earlier eval on strict call frame.&quot;); });
+            testEvaluateOnStrictCallFrameThrows(&quot;createdConstLocalVariable&quot;, (wasThrown) =&gt; { InspectorTest.expectThat(wasThrown, &quot;Should not be able to access local const created in earlier eval on strict call frame.&quot;); });
+
+            testEvaluateOnNonStrictCallFrame(`
+                var createdVarLocalVariable = 1;
+                let createdLetLocalVariable = 2;
+                const createdConstLocalVariable = 3;
+            `);
+            testEvaluateOnNonStrictCallFrame(&quot;createdVarLocalVariable&quot;, (resultValue) =&gt; { InspectorTest.expectThat(resultValue === 1, &quot;Should be able to access local var created in earlier eval on non-strict call frame.&quot;); });
+            testEvaluateOnNonStrictCallFrameThrows(&quot;createdLetLocalVariable&quot;, (wasThrown) =&gt; { InspectorTest.expectThat(wasThrown, &quot;Should not be able to access local let created in earlier eval on non-strict call frame.&quot;); });
+            testEvaluateOnNonStrictCallFrameThrows(&quot;createdConstLocalVariable&quot;, (wasThrown) =&gt; { InspectorTest.expectThat(wasThrown, &quot;Should not be able to access local const created in earlier eval on non-strict call frame.&quot;); resolve(); });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;NonStrictAndStrictEvaluations&quot;,
+        description: &quot;Test evaluate can run strict and non-strict programs.&quot;,
+        test: (resolve, reject) =&gt; {
+            // Non strict, this is okay.
+            testEvaluateOnNonStrictCallFrame(&quot;arguments.callee.name&quot;, (resultValue) =&gt; {
+                InspectorTest.expectThat(resultValue === &quot;foo&quot;, &quot;Non-strict evaluation. Should be able to access arguments.callee.&quot;);
+            });
+            // Strict, this throw an exception.
+            testEvaluateOnStrictCallFrameThrows(&quot;arguments.callee.name&quot;, (wasThrown) =&gt; {
+                InspectorTest.expectThat(wasThrown, &quot;Strict evaluation. Should not be able to access arguments.callee.&quot;);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;CommandLineAPIDoesNotShadowLocalVariables&quot;,
+        description: &quot;Test CommandLineAPI does not shadow local variables.&quot;,
+        test: (resolve, reject) =&gt; {
+            testEvaluateOnNonStrictCallFrame(&quot;keys&quot;, (resultValue) =&gt; {
+                InspectorTest.expectThat(resultValue === 123, &quot;Local variable `keys` should not be shadowed by CommandLineAPI `keys` function in call frame for `foo`.&quot;);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;CommandLineAPIDoesNotShadowGlobalVariables&quot;,
+        description: &quot;Test CommandLineAPI does not shadow global variables.&quot;,
+        test: (resolve, reject) =&gt; {
+            testEvaluateOnStrictCallFrame(&quot;keys.toString()&quot;, (resultValue) =&gt; {
+                InspectorTest.expectThat(resultValue.includes(&quot;[Command Line API]&quot;), &quot;CommandLineAPI `keys` can be accessed in the `bar` strict call frame.&quot;);
+            });
+            testEvaluateOnStrictCallFrame(&quot;window.keys = 999&quot;, (resultValue) =&gt; {
+                InspectorTest.expectThat(resultValue === 999, &quot;Global assignment to `keys` should be okay.&quot;);
+            });
+            testEvaluateOnStrictCallFrame(&quot;keys&quot;, (resultValue) =&gt; {
+                InspectorTest.expectThat(resultValue === 999, &quot;Global variable `keys` should not be shadowed by CommandLineAPI `keys` function in call frame for `bar`.&quot;);
+            });
+            testEvaluateOnStrictCallFrame(&quot;delete window.keys&quot;);
+            testEvaluateOnStrictCallFrame(&quot;keys.toString()&quot;, (resultValue) =&gt; {
+                InspectorTest.expectThat(resultValue.includes(&quot;[Command Line API]&quot;), &quot;CommandLineAPI `keys` can be accessed in the `bar` strict call frame after deleting global variable `keys`.&quot;);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;CommandLineAPIDoesNotShadowGlobalObjectProperties&quot;,
+        description: &quot;Test CommandLineAPI does not shadow global object properties.&quot;,
+        test: (resolve, reject) =&gt; {
+            testEvaluateOnStrictCallFrame(&quot;values.toString()&quot;, (resultValue) =&gt; {
+                InspectorTest.expectThat(resultValue === &quot;[object HTMLDivElement]&quot;, &quot;`values` should be `window.values` and not shadowed by CommandLineAPI `values` function in strict call frame.&quot;);
+            });
+            testEvaluateOnNonStrictCallFrame(&quot;values.toString()&quot;, (resultValue) =&gt; {
+                InspectorTest.expectThat(resultValue === &quot;[object HTMLDivElement]&quot;, &quot;`values` should be `window.values` and not shadowed by CommandLineAPI `values` function in non-strict call frame.&quot;);
+                resolve();
+            });
+        }
+    });
+
+    suite.addTestCase({
+        name: &quot;Complete&quot;,
+        test: (resolve, reject) =&gt; {
+            WebInspector.debuggerManager.resume();
+            resolve();
+        }
+    })
+
+    InspectorTest.evaluateInPage(&quot;triggerPause()&quot;);
+    WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.Paused, (event) =&gt; {
+        suite.runTestCasesAndFinish();
+    });
+}
+&lt;/script&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+&lt;div id=&quot;values&quot;&gt;&lt;/div&gt; &lt;!-- This introduces the named property `window.values` on the window global object. --&gt;
+&lt;p&gt;Tests for the Debugger.evaluateOnCallFrame with the Command Line API.&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 (200633 => 200634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-05-10 19:08:27 UTC (rev 200633)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-05-10 19:16:19 UTC (rev 200634)
</span><span class="lines">@@ -1,3 +1,44 @@
</span><ins>+2016-05-10  Joseph Pecoraro  &lt;pecoraro@apple.com&gt;
+
+        Web Inspector: Eliminate the crazy code for evaluateOnCallFrame
+        https://bugs.webkit.org/show_bug.cgi?id=157510
+        &lt;rdar://problem/26191332&gt;
+
+        Reviewed by Timothy Hatcher.
+
+        * debugger/DebuggerCallFrame.cpp:
+        (JSC::DebuggerCallFrame::evaluateWithScopeExtension):
+        Set and clear an optional scope extension object.
+
+        * inspector/InjectedScriptSource.js:
+        (InjectedScript.prototype.evaluate):
+        (InjectedScript.prototype._evaluateOn):
+        (InjectedScript.prototype.evaluateOnCallFrame):
+        Unify the code to use the passed in evaluate function and object.
+        When evaluating on a call frame the evaluate function ends up being
+        DebuggerCallFrame::evaluateWithScopeExtension. When evaluating globally
+        this ends up being JSInjectedScriptHost::evaluateWithScopeExtension.
+        In both cases &quot;object&quot; is the preferred this object to use.
+
+        * debugger/DebuggerCallFrame.h:
+        * inspector/JSJavaScriptCallFrame.cpp:
+        (Inspector::JSJavaScriptCallFrame::evaluateWithScopeExtension):
+        (Inspector::JSJavaScriptCallFrame::evaluate): Deleted.
+        * inspector/JSJavaScriptCallFrame.h:
+        * inspector/JSJavaScriptCallFramePrototype.cpp:
+        (Inspector::JSJavaScriptCallFramePrototype::finishCreation):
+        (Inspector::jsJavaScriptCallFramePrototypeFunctionEvaluateWithScopeExtension):
+        * inspector/JavaScriptCallFrame.h:
+        (Inspector::JavaScriptCallFrame::evaluateWithScopeExtension):
+        (Inspector::JavaScriptCallFrame::evaluate): Deleted.
+        Pass through to DebuggerCallFrame with the proper arguments.
+
+        * debugger/Debugger.cpp:
+        (JSC::Debugger::hasBreakpoint):
+        * inspector/ScriptDebugServer.cpp:
+        (Inspector::ScriptDebugServer::evaluateBreakpointAction):
+        Use the new evaluate on call frame method name and no scope extension object.
+
</ins><span class="cx"> 2016-05-10  Saam barati  &lt;sbarati@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Make super-property-access.js test run for less time because it was timing out in debug builds.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/Debugger.cpp (200633 => 200634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/Debugger.cpp        2016-05-10 19:08:27 UTC (rev 200633)
+++ trunk/Source/JavaScriptCore/debugger/Debugger.cpp        2016-05-10 19:16:19 UTC (rev 200634)
</span><span class="lines">@@ -453,7 +453,8 @@
</span><span class="cx"> 
</span><span class="cx">     NakedPtr&lt;Exception&gt; exception;
</span><span class="cx">     DebuggerCallFrame* debuggerCallFrame = currentDebuggerCallFrame();
</span><del>-    JSValue result = debuggerCallFrame-&gt;evaluate(breakpoint-&gt;condition, exception);
</del><ins>+    JSObject* scopeExtensionObject = nullptr;
+    JSValue result = debuggerCallFrame-&gt;evaluateWithScopeExtension(breakpoint-&gt;condition, scopeExtensionObject, exception);
</ins><span class="cx"> 
</span><span class="cx">     // We can lose the debugger while executing JavaScript.
</span><span class="cx">     if (!m_currentCallFrame)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggerCallFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp (200633 => 200634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp        2016-05-10 19:08:27 UTC (rev 200633)
+++ trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.cpp        2016-05-10 19:16:19 UTC (rev 200634)
</span><span class="lines">@@ -33,9 +33,10 @@
</span><span class="cx"> #include &quot;DebuggerEvalEnabler.h&quot;
</span><span class="cx"> #include &quot;DebuggerScope.h&quot;
</span><span class="cx"> #include &quot;Interpreter.h&quot;
</span><ins>+#include &quot;JSCInlines.h&quot;
</ins><span class="cx"> #include &quot;JSFunction.h&quot;
</span><span class="cx"> #include &quot;JSLexicalEnvironment.h&quot;
</span><del>-#include &quot;JSCInlines.h&quot;
</del><ins>+#include &quot;JSWithScope.h&quot;
</ins><span class="cx"> #include &quot;Parser.h&quot;
</span><span class="cx"> #include &quot;StackVisitor.h&quot;
</span><span class="cx"> #include &quot;StrongInlines.h&quot;
</span><span class="lines">@@ -175,17 +176,17 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // Evaluate some JavaScript code in the scope of this frame.
</span><del>-JSValue DebuggerCallFrame::evaluate(const String&amp; script, NakedPtr&lt;Exception&gt;&amp; exception)
</del><ins>+JSValue DebuggerCallFrame::evaluateWithScopeExtension(const String&amp; script, JSObject* scopeExtensionObject, NakedPtr&lt;Exception&gt;&amp; exception)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(isValid());
</span><span class="cx">     CallFrame* callFrame = m_callFrame;
</span><span class="cx">     if (!callFrame)
</span><del>-        return jsNull();
</del><ins>+        return jsUndefined();
</ins><span class="cx"> 
</span><span class="cx">     JSLockHolder lock(callFrame);
</span><span class="cx"> 
</span><span class="cx">     if (!callFrame-&gt;codeBlock())
</span><del>-        return JSValue();
</del><ins>+        return jsUndefined();
</ins><span class="cx">     
</span><span class="cx">     DebuggerEvalEnabler evalEnabler(callFrame);
</span><span class="cx">     VM&amp; vm = callFrame-&gt;vm();
</span><span class="lines">@@ -211,12 +212,22 @@
</span><span class="cx">         return jsUndefined();
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    JSGlobalObject* globalObject = callFrame-&gt;vmEntryGlobalObject();
+    if (scopeExtensionObject) {
+        JSScope* ignoredPreviousScope = globalObject-&gt;globalScope();
+        globalObject-&gt;setGlobalScopeExtension(JSWithScope::create(vm, globalObject, scopeExtensionObject, ignoredPreviousScope));
+    }
+
</ins><span class="cx">     JSValue thisValue = thisValueForCallFrame(callFrame);
</span><span class="cx">     JSValue result = vm.interpreter-&gt;execute(eval, callFrame, thisValue, scope()-&gt;jsScope());
</span><span class="cx">     if (vm.exception()) {
</span><span class="cx">         exception = vm.exception();
</span><span class="cx">         vm.clearException();
</span><span class="cx">     }
</span><ins>+
+    if (scopeExtensionObject)
+        globalObject-&gt;clearGlobalScopeExtension();
+
</ins><span class="cx">     ASSERT(result);
</span><span class="cx">     return result;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoredebuggerDebuggerCallFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.h (200633 => 200634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.h        2016-05-10 19:08:27 UTC (rev 200633)
+++ trunk/Source/JavaScriptCore/debugger/DebuggerCallFrame.h        2016-05-10 19:16:19 UTC (rev 200634)
</span><span class="lines">@@ -68,7 +68,7 @@
</span><span class="cx">     JS_EXPORT_PRIVATE String functionName() const;
</span><span class="cx">     JS_EXPORT_PRIVATE Type type() const;
</span><span class="cx">     JS_EXPORT_PRIVATE JSValue thisValue() const;
</span><del>-    JSValue evaluate(const String&amp;, NakedPtr&lt;Exception&gt;&amp;);
</del><ins>+    JSValue evaluateWithScopeExtension(const String&amp;, JSObject* scopeExtensionObject, NakedPtr&lt;Exception&gt;&amp;);
</ins><span class="cx"> 
</span><span class="cx">     bool isValid() const { return !!m_callFrame; }
</span><span class="cx">     JS_EXPORT_PRIVATE void invalidate();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorInjectedScriptSourcejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js (200633 => 200634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2016-05-10 19:08:27 UTC (rev 200633)
+++ trunk/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2016-05-10 19:16:19 UTC (rev 200634)
</span><span class="lines">@@ -380,7 +380,7 @@
</span><span class="cx"> 
</span><span class="cx">     evaluate: function(expression, objectGroup, injectCommandLineAPI, returnByValue, generatePreview, saveResult)
</span><span class="cx">     {
</span><del>-        return this._evaluateAndWrap(InjectedScriptHost.evaluate, InjectedScriptHost, expression, objectGroup, false, injectCommandLineAPI, returnByValue, generatePreview, saveResult);
</del><ins>+        return this._evaluateAndWrap(InjectedScriptHost.evaluateWithScopeExtension, InjectedScriptHost, expression, objectGroup, false, injectCommandLineAPI, returnByValue, generatePreview, saveResult);
</ins><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     callFunctionOn: function(objectId, expression, args, returnByValue, generatePreview)
</span><span class="lines">@@ -479,50 +479,7 @@
</span><span class="cx">                 commandLineAPI = new BasicCommandLineAPI(isEvalOnCallFrame ? object : null);
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        if (isEvalOnCallFrame) {
-            // We can only use this approach if the evaluate function is the true 'eval'. That allows us to use it with
-            // the 'eval' identifier when calling it. Using 'eval' grants access to the local scope of the closure we
-            // create that provides the command line APIs.
-
-            var parameters = [InjectedScriptHost.evaluate, expression];
-            var expressionFunctionBody = &quot;&quot; +
-                &quot;var global = Function('return this')() || (1, eval)('this');&quot; +
-                &quot;var __originalEval = global.eval; global.eval = __eval;&quot; +
-                &quot;try { return eval(__currentExpression); }&quot; +
-                &quot;finally { global.eval = __originalEval; }&quot;;
-
-            if (commandLineAPI) {
-                // To avoid using a 'with' statement (which fails in strict mode and requires injecting the API object)
-                // we instead create a closure where we evaluate the expression. The command line APIs are passed as
-                // parameters to the closure so they are in scope but not injected. This allows the code evaluated in
-                // the console to stay in strict mode (if is was already set), or to get strict mode by prefixing
-                // expressions with 'use strict';.
-
-                var parameterNames = Object.getOwnPropertyNames(commandLineAPI);
-                for (var i = 0; i &lt; parameterNames.length; ++i)
-                    parameters.push(commandLineAPI[parameterNames[i]]);
-
-                var expressionFunctionString = &quot;(function(__eval, __currentExpression, &quot; + parameterNames.join(&quot;, &quot;) + &quot;) { &quot; + expressionFunctionBody + &quot; })&quot;;
-            } else {
-                // Use a closure in this case too to keep the same behavior of 'var' being captured by the closure instead
-                // of leaking out into the calling scope.
-                var expressionFunctionString = &quot;(function(__eval, __currentExpression) { &quot; + expressionFunctionBody + &quot; })&quot;;
-            }
-
-            // Bind 'this' to the function expression using another closure instead of Function.prototype.bind. This ensures things will work if the page replaces bind.
-            var boundExpressionFunctionString = &quot;(function(__function, __thisObject) { return function() { return __function.apply(__thisObject, arguments) }; })(&quot; + expressionFunctionString + &quot;, this)&quot;;
-            var expressionFunction = evalFunction.call(object, boundExpressionFunctionString);
-            var result = expressionFunction.apply(null, parameters);
-
-            if (saveResult)
-                this._saveResult(result);
-
-            return result;
-        }
-
-        // When not evaluating on a call frame, we evaluate as a program
-        // with the Command Line API as a scope extension object.
-        var result = InjectedScriptHost.evaluateWithScopeExtension(expression, commandLineAPI);
</del><ins>+        var result = evalFunction.call(object, expression, commandLineAPI);        
</ins><span class="cx">         if (saveResult)
</span><span class="cx">             this._saveResult(result);
</span><span class="cx">         return result;
</span><span class="lines">@@ -547,7 +504,7 @@
</span><span class="cx">         var callFrame = this._callFrameForId(topCallFrame, callFrameId);
</span><span class="cx">         if (!callFrame)
</span><span class="cx">             return &quot;Could not find call frame with given id&quot;;
</span><del>-        return this._evaluateAndWrap(callFrame.evaluate, callFrame, expression, objectGroup, true, injectCommandLineAPI, returnByValue, generatePreview, saveResult);
</del><ins>+        return this._evaluateAndWrap(callFrame.evaluateWithScopeExtension, callFrame, expression, objectGroup, true, injectCommandLineAPI, returnByValue, generatePreview, saveResult);
</ins><span class="cx">     },
</span><span class="cx"> 
</span><span class="cx">     _callFrameForId: function(topCallFrame, callFrameId)
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSJavaScriptCallFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp (200633 => 200634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp        2016-05-10 19:08:27 UTC (rev 200633)
+++ trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.cpp        2016-05-10 19:16:19 UTC (rev 200634)
</span><span class="lines">@@ -73,10 +73,15 @@
</span><span class="cx">     releaseImpl();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-JSValue JSJavaScriptCallFrame::evaluate(ExecState* exec)
</del><ins>+JSValue JSJavaScriptCallFrame::evaluateWithScopeExtension(ExecState* exec)
</ins><span class="cx"> {
</span><ins>+    String script = exec-&gt;argument(0).toString(exec)-&gt;value(exec);
+    if (exec-&gt;hadException())
+        return jsUndefined();
+
</ins><span class="cx">     NakedPtr&lt;Exception&gt; exception;
</span><del>-    JSValue result = impl().evaluate(exec-&gt;argument(0).toString(exec)-&gt;value(exec), exception);
</del><ins>+    JSObject* scopeExtension = exec-&gt;argument(1).getObject();
+    JSValue result = impl().evaluateWithScopeExtension(script, scopeExtension, exception);
</ins><span class="cx">     if (exception)
</span><span class="cx">         exec-&gt;vm().throwException(exec, exception);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSJavaScriptCallFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.h (200633 => 200634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.h        2016-05-10 19:08:27 UTC (rev 200633)
+++ trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFrame.h        2016-05-10 19:16:19 UTC (rev 200634)
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx">     void releaseImpl();
</span><span class="cx"> 
</span><span class="cx">     // Functions.
</span><del>-    JSC::JSValue evaluate(JSC::ExecState*);
</del><ins>+    JSC::JSValue evaluateWithScopeExtension(JSC::ExecState*);
</ins><span class="cx">     JSC::JSValue scopeType(JSC::ExecState*);
</span><span class="cx"> 
</span><span class="cx">     // Attributes.
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJSJavaScriptCallFramePrototypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFramePrototype.cpp (200633 => 200634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFramePrototype.cpp        2016-05-10 19:08:27 UTC (rev 200633)
+++ trunk/Source/JavaScriptCore/inspector/JSJavaScriptCallFramePrototype.cpp        2016-05-10 19:16:19 UTC (rev 200634)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx"> namespace Inspector {
</span><span class="cx"> 
</span><span class="cx"> // Functions.
</span><del>-static EncodedJSValue JSC_HOST_CALL jsJavaScriptCallFramePrototypeFunctionEvaluate(ExecState*);
</del><ins>+static EncodedJSValue JSC_HOST_CALL jsJavaScriptCallFramePrototypeFunctionEvaluateWithScopeExtension(ExecState*);
</ins><span class="cx"> static EncodedJSValue JSC_HOST_CALL jsJavaScriptCallFramePrototypeFunctionScopeType(ExecState*);
</span><span class="cx"> 
</span><span class="cx"> // Attributes.
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">     ASSERT(inherits(info()));
</span><span class="cx">     vm.prototypeMap.addPrototype(this);
</span><span class="cx"> 
</span><del>-    JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(&quot;evaluate&quot;, jsJavaScriptCallFramePrototypeFunctionEvaluate, DontEnum, 1);
</del><ins>+    JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(&quot;evaluateWithScopeExtension&quot;, jsJavaScriptCallFramePrototypeFunctionEvaluateWithScopeExtension, DontEnum, 1);
</ins><span class="cx">     JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION(&quot;scopeType&quot;, jsJavaScriptCallFramePrototypeFunctionScopeType, DontEnum, 1);
</span><span class="cx"> 
</span><span class="cx">     JSC_NATIVE_GETTER(&quot;caller&quot;, jsJavaScriptCallFrameAttributeCaller, DontEnum | Accessor);
</span><span class="lines">@@ -72,15 +72,14 @@
</span><span class="cx">     JSC_NATIVE_GETTER(&quot;type&quot;, jsJavaScriptCallFrameAttributeType, DontEnum | Accessor);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-EncodedJSValue JSC_HOST_CALL jsJavaScriptCallFramePrototypeFunctionEvaluate(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL jsJavaScriptCallFramePrototypeFunctionEvaluateWithScopeExtension(ExecState* exec)
</ins><span class="cx"> {
</span><span class="cx">     JSValue thisValue = exec-&gt;thisValue();
</span><span class="cx">     JSJavaScriptCallFrame* castedThis = jsDynamicCast&lt;JSJavaScriptCallFrame*&gt;(thisValue);
</span><span class="cx">     if (!castedThis)
</span><span class="cx">         return throwVMTypeError(exec);
</span><span class="cx"> 
</span><del>-    ASSERT_GC_OBJECT_INHERITS(castedThis, JSJavaScriptCallFrame::info());
-    return JSValue::encode(castedThis-&gt;evaluate(exec));
</del><ins>+    return JSValue::encode(castedThis-&gt;evaluateWithScopeExtension(exec));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL jsJavaScriptCallFramePrototypeFunctionScopeType(ExecState* exec)
</span><span class="lines">@@ -90,7 +89,6 @@
</span><span class="cx">     if (!castedThis)
</span><span class="cx">         return throwVMTypeError(exec);
</span><span class="cx"> 
</span><del>-    ASSERT_GC_OBJECT_INHERITS(castedThis, JSJavaScriptCallFrame::info());
</del><span class="cx">     return JSValue::encode(castedThis-&gt;scopeType(exec));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -101,7 +99,6 @@
</span><span class="cx">     if (!castedThis)
</span><span class="cx">         return throwVMTypeError(exec);
</span><span class="cx"> 
</span><del>-    ASSERT_GC_OBJECT_INHERITS(castedThis, JSJavaScriptCallFrame::info());
</del><span class="cx">     return JSValue::encode(castedThis-&gt;caller(exec));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -112,7 +109,6 @@
</span><span class="cx">     if (!castedThis)
</span><span class="cx">         return throwVMTypeError(exec);
</span><span class="cx"> 
</span><del>-    ASSERT_GC_OBJECT_INHERITS(castedThis, JSJavaScriptCallFrame::info());
</del><span class="cx">     return JSValue::encode(castedThis-&gt;sourceID(exec));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -123,7 +119,6 @@
</span><span class="cx">     if (!castedThis)
</span><span class="cx">         return throwVMTypeError(exec);
</span><span class="cx"> 
</span><del>-    ASSERT_GC_OBJECT_INHERITS(castedThis, JSJavaScriptCallFrame::info());
</del><span class="cx">     return JSValue::encode(castedThis-&gt;line(exec));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -134,7 +129,6 @@
</span><span class="cx">     if (!castedThis)
</span><span class="cx">         return throwVMTypeError(exec);
</span><span class="cx"> 
</span><del>-    ASSERT_GC_OBJECT_INHERITS(castedThis, JSJavaScriptCallFrame::info());
</del><span class="cx">     return JSValue::encode(castedThis-&gt;column(exec));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -145,7 +139,6 @@
</span><span class="cx">     if (!castedThis)
</span><span class="cx">         return throwVMTypeError(exec);
</span><span class="cx"> 
</span><del>-    ASSERT_GC_OBJECT_INHERITS(castedThis, JSJavaScriptCallFrame::info());
</del><span class="cx">     return JSValue::encode(castedThis-&gt;functionName(exec));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -156,7 +149,6 @@
</span><span class="cx">     if (!castedThis)
</span><span class="cx">         return throwVMTypeError(exec);
</span><span class="cx"> 
</span><del>-    ASSERT_GC_OBJECT_INHERITS(castedThis, JSJavaScriptCallFrame::info());
</del><span class="cx">     return JSValue::encode(castedThis-&gt;scopeChain(exec));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -167,7 +159,6 @@
</span><span class="cx">     if (!castedThis)
</span><span class="cx">         return throwVMTypeError(exec);
</span><span class="cx"> 
</span><del>-    ASSERT_GC_OBJECT_INHERITS(castedThis, JSJavaScriptCallFrame::info());
</del><span class="cx">     return JSValue::encode(castedThis-&gt;thisObject(exec));
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -178,7 +169,6 @@
</span><span class="cx">     if (!castedThis)
</span><span class="cx">         return throwVMTypeError(exec);
</span><span class="cx"> 
</span><del>-    ASSERT_GC_OBJECT_INHERITS(castedThis, JSJavaScriptCallFrame::info());
</del><span class="cx">     return JSValue::encode(castedThis-&gt;type(exec));
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorJavaScriptCallFrameh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/JavaScriptCallFrame.h (200633 => 200634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/JavaScriptCallFrame.h        2016-05-10 19:08:27 UTC (rev 200633)
+++ trunk/Source/JavaScriptCore/inspector/JavaScriptCallFrame.h        2016-05-10 19:16:19 UTC (rev 200634)
</span><span class="lines">@@ -55,7 +55,7 @@
</span><span class="cx">     JSC::JSGlobalObject* vmEntryGlobalObject() const { return m_debuggerCallFrame-&gt;vmEntryGlobalObject(); }
</span><span class="cx"> 
</span><span class="cx">     JSC::JSValue thisValue() const { return m_debuggerCallFrame-&gt;thisValue(); }
</span><del>-    JSC::JSValue evaluate(const String&amp; script, NakedPtr&lt;JSC::Exception&gt;&amp; exception) const  { return m_debuggerCallFrame-&gt;evaluate(script, exception); }
</del><ins>+    JSC::JSValue evaluateWithScopeExtension(const String&amp; script, JSC::JSObject* scopeExtension, NakedPtr&lt;JSC::Exception&gt;&amp; exception) const { return m_debuggerCallFrame-&gt;evaluateWithScopeExtension(script, scopeExtension, exception); }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     JavaScriptCallFrame(PassRefPtr&lt;JSC::DebuggerCallFrame&gt;);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreinspectorScriptDebugServercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp (200633 => 200634)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp        2016-05-10 19:08:27 UTC (rev 200633)
+++ trunk/Source/JavaScriptCore/inspector/ScriptDebugServer.cpp        2016-05-10 19:16:19 UTC (rev 200634)
</span><span class="lines">@@ -94,7 +94,8 @@
</span><span class="cx">     }
</span><span class="cx">     case ScriptBreakpointActionTypeEvaluate: {
</span><span class="cx">         NakedPtr&lt;Exception&gt; exception;
</span><del>-        debuggerCallFrame-&gt;evaluate(breakpointAction.data, exception);
</del><ins>+        JSObject* scopeExtensionObject = nullptr;
+        debuggerCallFrame-&gt;evaluateWithScopeExtension(breakpointAction.data, scopeExtensionObject, exception);
</ins><span class="cx">         if (exception)
</span><span class="cx">             reportException(debuggerCallFrame-&gt;exec(), exception);
</span><span class="cx">         break;
</span><span class="lines">@@ -104,7 +105,8 @@
</span><span class="cx">         break;
</span><span class="cx">     case ScriptBreakpointActionTypeProbe: {
</span><span class="cx">         NakedPtr&lt;Exception&gt; exception;
</span><del>-        JSValue result = debuggerCallFrame-&gt;evaluate(breakpointAction.data, exception);
</del><ins>+        JSObject* scopeExtensionObject = nullptr;
+        JSValue result = debuggerCallFrame-&gt;evaluateWithScopeExtension(breakpointAction.data, scopeExtensionObject, exception);
</ins><span class="cx">         if (exception)
</span><span class="cx">             reportException(debuggerCallFrame-&gt;exec(), exception);
</span><span class="cx">         
</span></span></pre>
</div>
</div>

</body>
</html>