<!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
<rdar://problem/26191332>
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 "object" 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 <pecoraro@apple.com>
+
+ Web Inspector: Eliminate the crazy code for evaluateOnCallFrame
+ https://bugs.webkit.org/show_bug.cgi?id=157510
+ <rdar://problem/26191332>
+
+ 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 <jer.noble@apple.com>
</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>+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../http/tests/inspector/resources/inspector-test.js"></script>
+<script>
+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) {
+ "use strict";
+ let c = b + a + arguments[2];
+ debugger;
+ return c;
+}
+
+function triggerPause() {
+ foo.call("my-this-object", 1, 2, 3);
+}
+
+function test()
+{
+ const objectGroup = "test";
+ 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) => {
+ InspectorTest.assert(!error, "Should not be a protocol error.");
+ InspectorTest.assert(!wasThrown, "Should not be a runtime error.");
+ 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) => {
+ InspectorTest.assert(!error, "Should not be a protocol error.");
+ InspectorTest.assert(wasThrown, "Should be a runtime error.");
+ 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("Debugger.evaluateOnCallFrame.CommandLineAPI");
+
+ suite.addTestCase({
+ name: "ValidateCallFrames",
+ description: "Test6 evaluate can access CommandLineAPI methods.",
+ test: (resolve, reject) => {
+ InspectorTest.expectThat(WebInspector.debuggerManager.activeCallFrame.functionName === "bar", "Strict call frame is `bar`.");
+ InspectorTest.expectThat(WebInspector.debuggerManager.callFrames[1].functionName === "foo", "Non-strict call frame is `foo`.");
+
+ testEvaluateOnStrictCallFrame("a", (x) => { InspectorTest.expectThat(x === 6, "`a` should be 5 in `bar`."); });
+ testEvaluateOnStrictCallFrame("b", (x) => { InspectorTest.expectThat(x === 123, "`b` should be 123 in `bar`."); });
+ testEvaluateOnStrictCallFrame("c", (x) => { InspectorTest.expectThat(x === 0, "`c` should be 0 in `bar`."); });
+ testEvaluateOnStrictCallFrame("this", (x) => { InspectorTest.expectThat(x === undefined, "`this` should be undefined in `bar`."); });
+
+ testEvaluateOnNonStrictCallFrame("a", (x) => { InspectorTest.expectThat(x === 1, "`a` should be 1 in `foo`."); });
+ testEvaluateOnNonStrictCallFrame("b", (x) => { InspectorTest.expectThat(x === 2, "`b` should be 2 in `foo`."); });
+ testEvaluateOnNonStrictCallFrame("c", (x) => { InspectorTest.expectThat(x === 6, "`c` should be 6 in `foo`."); });
+ testEvaluateOnNonStrictCallFrame("this.toString()", (x) => { InspectorTest.expectThat(x === "my-this-object", "`this` should be 'my-this-object' in `foo`."); resolve(); });
+ }
+ });
+
+ suite.addTestCase({
+ name: "AccessCommandLineAPI",
+ description: "Test evaluate can access CommandLineAPI methods.",
+ test: (resolve, reject) => {
+ testEvaluateOnStrictCallFrame("keys.toString()", (resultValue) => {
+ InspectorTest.expectThat(resultValue.includes("[Command Line API]"), "CommandLineAPI `keys` can be accessed in the `bar` strict call frame.");
+ });
+ testEvaluateOnNonStrictCallFrame("dir.toString()", (resultValue) => {
+ InspectorTest.expectThat(resultValue.includes("[Command Line API]"), "CommandLineAPI `keys` can be accessed in the `foo` non-strict call frame.");
+ });
+ testEvaluateOnStrictCallFrame("keys({a:1, b:2})", (resultValue) => {
+ InspectorTest.expectThat(resultValue.length === 2 && resultValue[0] === "a" && resultValue[1] === "b", "CommandLineAPI `keys` should work with a simple object.");
+ resolve();
+ });
+ }
+ });
+
+ suite.addTestCase({
+ name: "AccessGlobalVariable",
+ description: "Test evaluate can access global variables.",
+ test: (resolve, reject) => {
+ testEvaluateOnStrictCallFrame("varGlobalVariable", (x) => { InspectorTest.expectThat(x === 1, "Should be able to access var in global scope in strict call frame."); });
+ testEvaluateOnStrictCallFrame("letGlobalVariable", (x) => { InspectorTest.expectThat(x === 2, "Should be able to access let in global scope in strict call frame."); });
+ testEvaluateOnStrictCallFrame("constGlobalVariable", (x) => { InspectorTest.expectThat(x === 3, "Should be able to access const in global scope in strict call frame."); });
+
+ testEvaluateOnNonStrictCallFrame("varGlobalVariable", (x) => { InspectorTest.expectThat(x === 1, "Should be able to access var in global scope in non-strict call frame."); });
+ testEvaluateOnNonStrictCallFrame("letGlobalVariable", (x) => { InspectorTest.expectThat(x === 2, "Should be able to access let in global scope in non-strict call frame."); });
+ testEvaluateOnNonStrictCallFrame("constGlobalVariable", (x) => { InspectorTest.expectThat(x === 3, "Should be able to access const in global scope in non-strict call frame."); resolve(); });
+ }
+ });
+
+ suite.addTestCase({
+ name: "NoVariablesCreatedOnCallFrame",
+ description: "Test evaluate may not create new local variables.",
+ test: (resolve, reject) => {
+ testEvaluateOnStrictCallFrame(`
+ var createdVarLocalVariable = 1;
+ let createdLetLocalVariable = 2;
+ const createdConstLocalVariable = 3;
+ `);
+ testEvaluateOnStrictCallFrameThrows("createdVarLocalVariable", (wasThrown) => { InspectorTest.expectThat(wasThrown, "Should not be able to access local var created in earlier eval on strict call frame."); });
+ testEvaluateOnStrictCallFrameThrows("createdLetLocalVariable", (wasThrown) => { InspectorTest.expectThat(wasThrown, "Should not be able to access local let created in earlier eval on strict call frame."); });
+ testEvaluateOnStrictCallFrameThrows("createdConstLocalVariable", (wasThrown) => { InspectorTest.expectThat(wasThrown, "Should not be able to access local const created in earlier eval on strict call frame."); });
+
+ testEvaluateOnNonStrictCallFrame(`
+ var createdVarLocalVariable = 1;
+ let createdLetLocalVariable = 2;
+ const createdConstLocalVariable = 3;
+ `);
+ testEvaluateOnNonStrictCallFrame("createdVarLocalVariable", (resultValue) => { InspectorTest.expectThat(resultValue === 1, "Should be able to access local var created in earlier eval on non-strict call frame."); });
+ testEvaluateOnNonStrictCallFrameThrows("createdLetLocalVariable", (wasThrown) => { InspectorTest.expectThat(wasThrown, "Should not be able to access local let created in earlier eval on non-strict call frame."); });
+ testEvaluateOnNonStrictCallFrameThrows("createdConstLocalVariable", (wasThrown) => { InspectorTest.expectThat(wasThrown, "Should not be able to access local const created in earlier eval on non-strict call frame."); resolve(); });
+ }
+ });
+
+ suite.addTestCase({
+ name: "NonStrictAndStrictEvaluations",
+ description: "Test evaluate can run strict and non-strict programs.",
+ test: (resolve, reject) => {
+ // Non strict, this is okay.
+ testEvaluateOnNonStrictCallFrame("arguments.callee.name", (resultValue) => {
+ InspectorTest.expectThat(resultValue === "foo", "Non-strict evaluation. Should be able to access arguments.callee.");
+ });
+ // Strict, this throw an exception.
+ testEvaluateOnStrictCallFrameThrows("arguments.callee.name", (wasThrown) => {
+ InspectorTest.expectThat(wasThrown, "Strict evaluation. Should not be able to access arguments.callee.");
+ resolve();
+ });
+ }
+ });
+
+ suite.addTestCase({
+ name: "CommandLineAPIDoesNotShadowLocalVariables",
+ description: "Test CommandLineAPI does not shadow local variables.",
+ test: (resolve, reject) => {
+ testEvaluateOnNonStrictCallFrame("keys", (resultValue) => {
+ InspectorTest.expectThat(resultValue === 123, "Local variable `keys` should not be shadowed by CommandLineAPI `keys` function in call frame for `foo`.");
+ resolve();
+ });
+ }
+ });
+
+ suite.addTestCase({
+ name: "CommandLineAPIDoesNotShadowGlobalVariables",
+ description: "Test CommandLineAPI does not shadow global variables.",
+ test: (resolve, reject) => {
+ testEvaluateOnStrictCallFrame("keys.toString()", (resultValue) => {
+ InspectorTest.expectThat(resultValue.includes("[Command Line API]"), "CommandLineAPI `keys` can be accessed in the `bar` strict call frame.");
+ });
+ testEvaluateOnStrictCallFrame("window.keys = 999", (resultValue) => {
+ InspectorTest.expectThat(resultValue === 999, "Global assignment to `keys` should be okay.");
+ });
+ testEvaluateOnStrictCallFrame("keys", (resultValue) => {
+ InspectorTest.expectThat(resultValue === 999, "Global variable `keys` should not be shadowed by CommandLineAPI `keys` function in call frame for `bar`.");
+ });
+ testEvaluateOnStrictCallFrame("delete window.keys");
+ testEvaluateOnStrictCallFrame("keys.toString()", (resultValue) => {
+ InspectorTest.expectThat(resultValue.includes("[Command Line API]"), "CommandLineAPI `keys` can be accessed in the `bar` strict call frame after deleting global variable `keys`.");
+ resolve();
+ });
+ }
+ });
+
+ suite.addTestCase({
+ name: "CommandLineAPIDoesNotShadowGlobalObjectProperties",
+ description: "Test CommandLineAPI does not shadow global object properties.",
+ test: (resolve, reject) => {
+ testEvaluateOnStrictCallFrame("values.toString()", (resultValue) => {
+ InspectorTest.expectThat(resultValue === "[object HTMLDivElement]", "`values` should be `window.values` and not shadowed by CommandLineAPI `values` function in strict call frame.");
+ });
+ testEvaluateOnNonStrictCallFrame("values.toString()", (resultValue) => {
+ InspectorTest.expectThat(resultValue === "[object HTMLDivElement]", "`values` should be `window.values` and not shadowed by CommandLineAPI `values` function in non-strict call frame.");
+ resolve();
+ });
+ }
+ });
+
+ suite.addTestCase({
+ name: "Complete",
+ test: (resolve, reject) => {
+ WebInspector.debuggerManager.resume();
+ resolve();
+ }
+ })
+
+ InspectorTest.evaluateInPage("triggerPause()");
+ WebInspector.debuggerManager.singleFireEventListener(WebInspector.DebuggerManager.Event.Paused, (event) => {
+ suite.runTestCasesAndFinish();
+ });
+}
+</script>
+</head>
+<body onload="runTest()">
+<div id="values"></div> <!-- This introduces the named property `window.values` on the window global object. -->
+<p>Tests for the Debugger.evaluateOnCallFrame with the Command Line API.</p>
+</body>
+</html>
</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 <pecoraro@apple.com>
+
+ Web Inspector: Eliminate the crazy code for evaluateOnCallFrame
+ https://bugs.webkit.org/show_bug.cgi?id=157510
+ <rdar://problem/26191332>
+
+ 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 "object" 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 <sbarati@apple.com>
</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<Exception> exception;
</span><span class="cx"> DebuggerCallFrame* debuggerCallFrame = currentDebuggerCallFrame();
</span><del>- JSValue result = debuggerCallFrame->evaluate(breakpoint->condition, exception);
</del><ins>+ JSObject* scopeExtensionObject = nullptr;
+ JSValue result = debuggerCallFrame->evaluateWithScopeExtension(breakpoint->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 "DebuggerEvalEnabler.h"
</span><span class="cx"> #include "DebuggerScope.h"
</span><span class="cx"> #include "Interpreter.h"
</span><ins>+#include "JSCInlines.h"
</ins><span class="cx"> #include "JSFunction.h"
</span><span class="cx"> #include "JSLexicalEnvironment.h"
</span><del>-#include "JSCInlines.h"
</del><ins>+#include "JSWithScope.h"
</ins><span class="cx"> #include "Parser.h"
</span><span class="cx"> #include "StackVisitor.h"
</span><span class="cx"> #include "StrongInlines.h"
</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& script, NakedPtr<Exception>& exception)
</del><ins>+JSValue DebuggerCallFrame::evaluateWithScopeExtension(const String& script, JSObject* scopeExtensionObject, NakedPtr<Exception>& 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->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& vm = callFrame->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->vmEntryGlobalObject();
+ if (scopeExtensionObject) {
+ JSScope* ignoredPreviousScope = globalObject->globalScope();
+ globalObject->setGlobalScopeExtension(JSWithScope::create(vm, globalObject, scopeExtensionObject, ignoredPreviousScope));
+ }
+
</ins><span class="cx"> JSValue thisValue = thisValueForCallFrame(callFrame);
</span><span class="cx"> JSValue result = vm.interpreter->execute(eval, callFrame, thisValue, scope()->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->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&, NakedPtr<Exception>&);
</del><ins>+ JSValue evaluateWithScopeExtension(const String&, JSObject* scopeExtensionObject, NakedPtr<Exception>&);
</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 = "" +
- "var global = Function('return this')() || (1, eval)('this');" +
- "var __originalEval = global.eval; global.eval = __eval;" +
- "try { return eval(__currentExpression); }" +
- "finally { global.eval = __originalEval; }";
-
- 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 < parameterNames.length; ++i)
- parameters.push(commandLineAPI[parameterNames[i]]);
-
- var expressionFunctionString = "(function(__eval, __currentExpression, " + parameterNames.join(", ") + ") { " + expressionFunctionBody + " })";
- } 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 = "(function(__eval, __currentExpression) { " + expressionFunctionBody + " })";
- }
-
- // 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 = "(function(__function, __thisObject) { return function() { return __function.apply(__thisObject, arguments) }; })(" + expressionFunctionString + ", this)";
- 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 "Could not find call frame with given id";
</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->argument(0).toString(exec)->value(exec);
+ if (exec->hadException())
+ return jsUndefined();
+
</ins><span class="cx"> NakedPtr<Exception> exception;
</span><del>- JSValue result = impl().evaluate(exec->argument(0).toString(exec)->value(exec), exception);
</del><ins>+ JSObject* scopeExtension = exec->argument(1).getObject();
+ JSValue result = impl().evaluateWithScopeExtension(script, scopeExtension, exception);
</ins><span class="cx"> if (exception)
</span><span class="cx"> exec->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("evaluate", jsJavaScriptCallFramePrototypeFunctionEvaluate, DontEnum, 1);
</del><ins>+ JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("evaluateWithScopeExtension", jsJavaScriptCallFramePrototypeFunctionEvaluateWithScopeExtension, DontEnum, 1);
</ins><span class="cx"> JSC_NATIVE_FUNCTION_WITHOUT_TRANSITION("scopeType", jsJavaScriptCallFramePrototypeFunctionScopeType, DontEnum, 1);
</span><span class="cx">
</span><span class="cx"> JSC_NATIVE_GETTER("caller", jsJavaScriptCallFrameAttributeCaller, DontEnum | Accessor);
</span><span class="lines">@@ -72,15 +72,14 @@
</span><span class="cx"> JSC_NATIVE_GETTER("type", 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->thisValue();
</span><span class="cx"> JSJavaScriptCallFrame* castedThis = jsDynamicCast<JSJavaScriptCallFrame*>(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->evaluate(exec));
</del><ins>+ return JSValue::encode(castedThis->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->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->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->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->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->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->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->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->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->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->vmEntryGlobalObject(); }
</span><span class="cx">
</span><span class="cx"> JSC::JSValue thisValue() const { return m_debuggerCallFrame->thisValue(); }
</span><del>- JSC::JSValue evaluate(const String& script, NakedPtr<JSC::Exception>& exception) const { return m_debuggerCallFrame->evaluate(script, exception); }
</del><ins>+ JSC::JSValue evaluateWithScopeExtension(const String& script, JSC::JSObject* scopeExtension, NakedPtr<JSC::Exception>& exception) const { return m_debuggerCallFrame->evaluateWithScopeExtension(script, scopeExtension, exception); }
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> JavaScriptCallFrame(PassRefPtr<JSC::DebuggerCallFrame>);
</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<Exception> exception;
</span><del>- debuggerCallFrame->evaluate(breakpointAction.data, exception);
</del><ins>+ JSObject* scopeExtensionObject = nullptr;
+ debuggerCallFrame->evaluateWithScopeExtension(breakpointAction.data, scopeExtensionObject, exception);
</ins><span class="cx"> if (exception)
</span><span class="cx"> reportException(debuggerCallFrame->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<Exception> exception;
</span><del>- JSValue result = debuggerCallFrame->evaluate(breakpointAction.data, exception);
</del><ins>+ JSObject* scopeExtensionObject = nullptr;
+ JSValue result = debuggerCallFrame->evaluateWithScopeExtension(breakpointAction.data, scopeExtensionObject, exception);
</ins><span class="cx"> if (exception)
</span><span class="cx"> reportException(debuggerCallFrame->exec(), exception);
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>