<!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>[179680] branches/safari-600.1.4.15-branch</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/179680">179680</a></dd>
<dt>Author</dt> <dd>lforschler@apple.com</dd>
<dt>Date</dt> <dd>2015-02-05 00:55:50 -0800 (Thu, 05 Feb 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/178768">r178768</a>. rdar://problem/19651478</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6001415branchLayoutTestsChangeLog">branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari6001415branchSourceJavaScriptCoreChangeLog">branches/safari-600.1.4.15-branch/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#branchessafari6001415branchSourceJavaScriptCoreinspectorInjectedScriptcpp">branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/InjectedScript.cpp</a></li>
<li><a href="#branchessafari6001415branchSourceJavaScriptCoreinspectorInjectedScripth">branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/InjectedScript.h</a></li>
<li><a href="#branchessafari6001415branchSourceJavaScriptCoreinspectorInjectedScriptSourcejs">branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/InjectedScriptSource.js</a></li>
<li><a href="#branchessafari6001415branchSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgentcpp">branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp</a></li>
<li><a href="#branchessafari6001415branchSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgenth">branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h</a></li>
<li><a href="#branchessafari6001415branchSourceJavaScriptCoreinspectorprotocolRuntimejson">branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/protocol/Runtime.json</a></li>
<li><a href="#branchessafari6001415branchSourceWebInspectorUIChangeLog">branches/safari-600.1.4.15-branch/Source/WebInspectorUI/ChangeLog</a></li>
<li><a href="#branchessafari6001415branchSourceWebInspectorUIUserInterfaceProtocolRemoteObjectjs">branches/safari-600.1.4.15-branch/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js</a></li>
<li><a href="#branchessafari6001415branchSourceWebInspectorUIUserInterfaceViewsObjectPropertiesSectionjs">branches/safari-600.1.4.15-branch/Source/WebInspectorUI/UserInterface/Views/ObjectPropertiesSection.js</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li>branches/safari-600.1.4.15-branch/LayoutTests/inspector/model/</li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6001415branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog (179679 => 179680)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog        2015-02-05 08:19:19 UTC (rev 179679)
+++ branches/safari-600.1.4.15-branch/LayoutTests/ChangeLog        2015-02-05 08:55:50 UTC (rev 179680)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-02-05 Lucas Forschler <lforschler@apple.com>
+
+ Merge r178768
+
+ 2015-01-20 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values
+ https://bugs.webkit.org/show_bug.cgi?id=137306
+
+ Reviewed by Timothy Hatcher.
+
+ * inspector/model/remote-object-get-properties-expected.txt: Added.
+ * inspector/model/remote-object-get-properties.html: Added.
+
</ins><span class="cx"> 2015-02-04 Lucas Forschler <lforschler@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r178363
</span></span></pre></div>
<a id="branchessafari6001415branchSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/JavaScriptCore/ChangeLog (179679 => 179680)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/JavaScriptCore/ChangeLog        2015-02-05 08:19:19 UTC (rev 179679)
+++ branches/safari-600.1.4.15-branch/Source/JavaScriptCore/ChangeLog        2015-02-05 08:55:50 UTC (rev 179680)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2015-02-05 Lucas Forschler <lforschler@apple.com>
+
+ Merge r178768
+
+ 2015-01-20 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values
+ https://bugs.webkit.org/show_bug.cgi?id=137306
+
+ Reviewed by Timothy Hatcher.
+
+ Provide another optional parameter to getProperties, to gather a list
+ of all own and getter properties.
+
+ * inspector/InjectedScript.cpp:
+ (Inspector::InjectedScript::getProperties):
+ * inspector/InjectedScript.h:
+ * inspector/InjectedScriptSource.js:
+ * inspector/agents/InspectorRuntimeAgent.cpp:
+ (Inspector::InspectorRuntimeAgent::getProperties):
+ * inspector/agents/InspectorRuntimeAgent.h:
+ * inspector/protocol/Runtime.json:
+
</ins><span class="cx"> 2015-02-04 Lucas Forschler <lforschler@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r179329
</span></span></pre></div>
<a id="branchessafari6001415branchSourceJavaScriptCoreinspectorInjectedScriptcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/InjectedScript.cpp (179679 => 179680)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/InjectedScript.cpp        2015-02-05 08:19:19 UTC (rev 179679)
+++ branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/InjectedScript.cpp        2015-02-05 08:55:50 UTC (rev 179680)
</span><span class="lines">@@ -109,11 +109,12 @@
</span><span class="cx"> *result = Inspector::TypeBuilder::Debugger::FunctionDetails::runtimeCast(resultValue);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InjectedScript::getProperties(ErrorString* errorString, const String& objectId, bool ownProperties, RefPtr<Array<Inspector::TypeBuilder::Runtime::PropertyDescriptor>>* properties)
</del><ins>+void InjectedScript::getProperties(ErrorString* errorString, const String& objectId, bool ownProperties, bool ownAndGetterProperties, RefPtr<Array<Inspector::TypeBuilder::Runtime::PropertyDescriptor>>* properties)
</ins><span class="cx"> {
</span><span class="cx"> Deprecated::ScriptFunctionCall function(injectedScriptObject(), ASCIILiteral("getProperties"), inspectorEnvironment()->functionCallHandler());
</span><span class="cx"> function.appendArgument(objectId);
</span><span class="cx"> function.appendArgument(ownProperties);
</span><ins>+ function.appendArgument(ownAndGetterProperties);
</ins><span class="cx">
</span><span class="cx"> RefPtr<InspectorValue> result;
</span><span class="cx"> makeCall(function, &result);
</span></span></pre></div>
<a id="branchessafari6001415branchSourceJavaScriptCoreinspectorInjectedScripth"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/InjectedScript.h (179679 => 179680)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/InjectedScript.h        2015-02-05 08:19:19 UTC (rev 179679)
+++ branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/InjectedScript.h        2015-02-05 08:55:50 UTC (rev 179680)
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx"> void callFunctionOn(ErrorString*, const String& objectId, const String& expression, const String& arguments, bool returnByValue, bool generatePreview, RefPtr<TypeBuilder::Runtime::RemoteObject>* result, TypeBuilder::OptOutput<bool>* wasThrown);
</span><span class="cx"> void evaluateOnCallFrame(ErrorString*, const Deprecated::ScriptValue& callFrames, const String& callFrameId, const String& expression, const String& objectGroup, bool includeCommandLineAPI, bool returnByValue, bool generatePreview, RefPtr<TypeBuilder::Runtime::RemoteObject>* result, TypeBuilder::OptOutput<bool>* wasThrown);
</span><span class="cx"> void getFunctionDetails(ErrorString*, const String& functionId, RefPtr<TypeBuilder::Debugger::FunctionDetails>* result);
</span><del>- void getProperties(ErrorString*, const String& objectId, bool ownProperties, RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::PropertyDescriptor>>* result);
</del><ins>+ void getProperties(ErrorString*, const String& objectId, bool ownProperties, bool ownAndGetterProperties, RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::PropertyDescriptor>>* result);
</ins><span class="cx"> void getInternalProperties(ErrorString*, const String& objectId, RefPtr<TypeBuilder::Array<TypeBuilder::Runtime::InternalPropertyDescriptor>>* result);
</span><span class="cx">
</span><span class="cx"> PassRefPtr<TypeBuilder::Array<TypeBuilder::Debugger::CallFrame>> wrapCallFrames(const Deprecated::ScriptValue&);
</span></span></pre></div>
<a id="branchessafari6001415branchSourceJavaScriptCoreinspectorInjectedScriptSourcejs"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/InjectedScriptSource.js (179679 => 179680)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-02-05 08:19:19 UTC (rev 179679)
+++ branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/InjectedScriptSource.js        2015-02-05 08:55:50 UTC (rev 179680)
</span><span class="lines">@@ -216,12 +216,7 @@
</span><span class="cx"> return result;
</span><span class="cx"> },
</span><span class="cx">
</span><del>- /**
- * @param {string} objectId
- * @param {boolean} ownProperties
- * @return {Array.<RuntimeAgent.PropertyDescriptor>|boolean}
- */
- getProperties: function(objectId, ownProperties)
</del><ins>+ getProperties: function(objectId, ownProperties, ownAndGetterProperties)
</ins><span class="cx"> {
</span><span class="cx"> var parsedObjectId = this._parseObjectId(objectId);
</span><span class="cx"> var object = this._objectForId(parsedObjectId);
</span><span class="lines">@@ -229,8 +224,9 @@
</span><span class="cx">
</span><span class="cx"> if (!this._isDefined(object))
</span><span class="cx"> return false;
</span><del>- var descriptors = this._propertyDescriptors(object, ownProperties);
</del><span class="cx">
</span><ins>+ var descriptors = this._propertyDescriptors(object, ownProperties, ownAndGetterProperties);
+
</ins><span class="cx"> // Go over properties, wrap object values.
</span><span class="cx"> for (var i = 0; i < descriptors.length; ++i) {
</span><span class="cx"> var descriptor = descriptors[i];
</span><span class="lines">@@ -245,6 +241,7 @@
</span><span class="cx"> if (!("enumerable" in descriptor))
</span><span class="cx"> descriptor.enumerable = false;
</span><span class="cx"> }
</span><ins>+
</ins><span class="cx"> return descriptors;
</span><span class="cx"> },
</span><span class="cx">
</span><span class="lines">@@ -318,70 +315,6 @@
</span><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> /**
</span><del>- * @param {Object} object
- * @param {boolean} ownProperties
- * @return {Array.<Object>}
- */
- _propertyDescriptors: function(object, ownProperties)
- {
- var descriptors = [];
- var nameProcessed = {};
- nameProcessed["__proto__"] = null;
- for (var o = object; this._isDefined(o); o = o.__proto__) {
- var names = Object.getOwnPropertyNames(/** @type {!Object} */ (o));
- for (var i = 0; i < names.length; ++i) {
- var name = names[i];
- if (nameProcessed[name])
- continue;
-
- try {
- nameProcessed[name] = true;
- var descriptor = Object.getOwnPropertyDescriptor(/** @type {!Object} */ (object), name);
- if (!descriptor) {
- // Not all bindings provide proper descriptors. Fall back to the writable, configurable property.
- try {
- descriptor = { name: name, value: object[name], writable: false, configurable: false, enumerable: false};
- if (o === object)
- descriptor.isOwn = true;
- descriptors.push(descriptor);
- } catch (e) {
- // Silent catch.
- }
- continue;
- }
- if (descriptor.hasOwnProperty("get") && descriptor.hasOwnProperty("set") && !descriptor.get && !descriptor.set) {
- // Not all bindings provide proper descriptors. Fall back to the writable, configurable property.
- try {
- descriptor = { name: name, value: object[name], writable: false, configurable: false, enumerable: false};
- if (o === object)
- descriptor.isOwn = true;
- descriptors.push(descriptor);
- } catch (e) {
- // Silent catch.
- }
- continue;
- }
- } catch (e) {
- var descriptor = {};
- descriptor.value = e;
- descriptor.wasThrown = true;
- }
-
- descriptor.name = name;
- if (o === object)
- descriptor.isOwn = true;
- descriptors.push(descriptor);
- }
- if (ownProperties) {
- if (object.__proto__)
- descriptors.push({ name: "__proto__", value: object.__proto__, writable: true, configurable: true, enumerable: false, isOwn: true});
- break;
- }
- }
- return descriptors;
- },
-
- /**
</del><span class="cx"> * @param {string} expression
</span><span class="cx"> * @param {string} objectGroup
</span><span class="cx"> * @param {boolean} injectCommandLineAPI
</span><span class="lines">@@ -679,6 +612,109 @@
</span><span class="cx"> return module;
</span><span class="cx"> },
</span><span class="cx">
</span><ins>+ _propertyDescriptors: function(object, ownProperties, ownAndGetterProperties)
+ {
+ // Modes:
+ // - ownProperties - only own properties and __proto__
+ // - ownAndGetterProperties - own properties, __proto__, and getters in the prototype chain
+ // - neither - get all properties in the prototype chain, exclude __proto__
+
+ var descriptors = [];
+ var nameProcessed = {};
+ nameProcessed["__proto__"] = null;
+
+ function createFakeValueDescriptor(name, descriptor, isOwnProperty)
+ {
+ try {
+ return {name: name, value: object[name], writable: descriptor.writable, configurable: descriptor.configurable, enumerable: descriptor.enumerable};
+ } catch (e) {
+ var errorDescriptor = {name: name, value: e, wasThrown: true};
+ if (isOwnProperty)
+ errorDescriptor.isOwn = true;
+ return errorDescriptor;
+ }
+ }
+
+ function processDescriptor(descriptor, isOwnProperty)
+ {
+ // Own properties only.
+ if (ownProperties) {
+ if (isOwnProperty)
+ descriptors.push(descriptor);
+ return;
+ }
+
+ // Own and getter properties.
+ if (ownAndGetterProperties) {
+ if (isOwnProperty) {
+ // Own property, include the descriptor as is.
+ descriptors.push(descriptor);
+ } else if (descriptor.hasOwnProperty("get") && descriptor.get) {
+ // Getter property in the prototype chain. Create a fake value descriptor.
+ descriptors.push(createFakeValueDescriptor(descriptor.name, descriptor, isOwnProperty));
+ } else if (descriptor.possibleNativeBindingGetter) {
+ // Possible getter property in the prototype chain.
+ descriptors.push(descriptor);
+ }
+ return;
+ }
+
+ // All properties.
+ descriptors.push(descriptor);
+ }
+
+ function processPropertyNames(o, names, isOwnProperty)
+ {
+ for (var i = 0; i < names.length; ++i) {
+ var name = names[i];
+ if (nameProcessed[name] || name === "__proto__")
+ continue;
+
+ nameProcessed[name] = true;
+
+ var descriptor = Object.getOwnPropertyDescriptor(o, name);
+ if (!descriptor) {
+ // FIXME: Bad descriptor. Can we get here?
+ // Fall back to very restrictive settings.
+ var fakeDescriptor = createFakeValueDescriptor(name, {writable: false, configurable: false, enumerable: false}, isOwnProperty);
+ processDescriptor(fakeDescriptor, isOwnProperty);
+ continue;
+ }
+
+ if (descriptor.hasOwnProperty("get") && descriptor.hasOwnProperty("set") && !descriptor.get && !descriptor.set) {
+ // FIXME: <https://webkit.org/b/140575> Web Inspector: Native Bindings Descriptors are Incomplete
+ // Developers may create such a descriptors, so we should be resilient:
+ // var x = {}; Object.defineProperty(x, "p", {get:undefined}); Object.getOwnPropertyDescriptor(x, "p")
+ var fakeDescriptor = createFakeValueDescriptor(name, descriptor, isOwnProperty);
+ fakeDescriptor.possibleNativeBindingGetter = true; // Native bindings.
+ processDescriptor(fakeDescriptor, isOwnProperty);
+ continue;
+ }
+
+ descriptor.name = name;
+ if (isOwnProperty)
+ descriptor.isOwn = true;
+ processDescriptor(descriptor, isOwnProperty);
+ }
+ }
+
+ // Iterate prototype chain.
+ for (var o = object; this._isDefined(o); o = o.__proto__) {
+ var isOwnProperty = o === object;
+ processPropertyNames(o, Object.getOwnPropertyNames(o), isOwnProperty);
+ if (ownProperties)
+ break;
+ }
+
+ // Include __proto__ at the end.
+ try {
+ if (object.__proto__)
+ descriptors.push({name: "__proto__", value: object.__proto__, writable: true, configurable: true, enumerable: false, isOwn: true});
+ } catch (e) {}
+
+ return descriptors;
+ },
+
</ins><span class="cx"> /**
</span><span class="cx"> * @param {*} object
</span><span class="cx"> * @return {boolean}
</span></span></pre></div>
<a id="branchessafari6001415branchSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgentcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp (179679 => 179680)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp        2015-02-05 08:19:19 UTC (rev 179679)
+++ branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.cpp        2015-02-05 08:55:50 UTC (rev 179680)
</span><span class="lines">@@ -157,7 +157,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void InspectorRuntimeAgent::getProperties(ErrorString* errorString, const String& objectId, const bool* const ownProperties, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::PropertyDescriptor>>& result, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::InternalPropertyDescriptor>>& internalProperties)
</del><ins>+void InspectorRuntimeAgent::getProperties(ErrorString* errorString, const String& objectId, const bool* const ownProperties, const bool* const ownAndGetterProperties, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::PropertyDescriptor>>& result, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::InternalPropertyDescriptor>>& internalProperties)
</ins><span class="cx"> {
</span><span class="cx"> InjectedScript injectedScript = m_injectedScriptManager->injectedScriptForObjectId(objectId);
</span><span class="cx"> if (injectedScript.hasNoValue()) {
</span><span class="lines">@@ -168,7 +168,7 @@
</span><span class="cx"> ScriptDebugServer::PauseOnExceptionsState previousPauseOnExceptionsState = setPauseOnExceptionsState(m_scriptDebugServer, ScriptDebugServer::DontPauseOnExceptions);
</span><span class="cx"> muteConsole();
</span><span class="cx">
</span><del>- injectedScript.getProperties(errorString, objectId, ownProperties ? *ownProperties : false, &result);
</del><ins>+ injectedScript.getProperties(errorString, objectId, ownProperties ? *ownProperties : false, ownAndGetterProperties ? *ownAndGetterProperties : false, &result);
</ins><span class="cx"> injectedScript.getInternalProperties(errorString, objectId, &internalProperties);
</span><span class="cx">
</span><span class="cx"> unmuteConsole();
</span></span></pre></div>
<a id="branchessafari6001415branchSourceJavaScriptCoreinspectoragentsInspectorRuntimeAgenth"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h (179679 => 179680)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h        2015-02-05 08:19:19 UTC (rev 179679)
+++ branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/agents/InspectorRuntimeAgent.h        2015-02-05 08:55:50 UTC (rev 179680)
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx"> virtual void evaluate(ErrorString*, const String& expression, const String* objectGroup, const bool* includeCommandLineAPI, const bool* doNotPauseOnExceptionsAndMuteConsole, const int* executionContextId, const bool* returnByValue, const bool* generatePreview, RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>& result, Inspector::TypeBuilder::OptOutput<bool>* wasThrown) override final;
</span><span class="cx"> virtual void callFunctionOn(ErrorString*, const String& objectId, const String& expression, const RefPtr<Inspector::InspectorArray>* optionalArguments, const bool* doNotPauseOnExceptionsAndMuteConsole, const bool* returnByValue, const bool* generatePreview, RefPtr<Inspector::TypeBuilder::Runtime::RemoteObject>& result, Inspector::TypeBuilder::OptOutput<bool>* wasThrown) override final;
</span><span class="cx"> virtual void releaseObject(ErrorString*, const ErrorString& objectId) override final;
</span><del>- virtual void getProperties(ErrorString*, const String& objectId, const bool* ownProperties, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::PropertyDescriptor>>& result, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::InternalPropertyDescriptor>>& internalProperties) override final;
</del><ins>+ virtual void getProperties(ErrorString*, const String& objectId, const bool* ownProperties, const bool* const ownAndGetterProperties, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::PropertyDescriptor>>& result, RefPtr<Inspector::TypeBuilder::Array<Inspector::TypeBuilder::Runtime::InternalPropertyDescriptor>>& internalProperties) override final;
</ins><span class="cx"> virtual void releaseObjectGroup(ErrorString*, const String& objectGroup) override final;
</span><span class="cx"> virtual void run(ErrorString*) override;
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari6001415branchSourceJavaScriptCoreinspectorprotocolRuntimejson"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/protocol/Runtime.json (179679 => 179680)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/protocol/Runtime.json        2015-02-05 08:19:19 UTC (rev 179679)
+++ branches/safari-600.1.4.15-branch/Source/JavaScriptCore/inspector/protocol/Runtime.json        2015-02-05 08:55:50 UTC (rev 179680)
</span><span class="lines">@@ -163,7 +163,8 @@
</span><span class="cx"> "name": "getProperties",
</span><span class="cx"> "parameters": [
</span><span class="cx"> { "name": "objectId", "$ref": "RemoteObjectId", "description": "Identifier of the object to return properties for." },
</span><del>- { "name": "ownProperties", "optional": true, "type": "boolean", "description": "If true, returns properties belonging only to the element itself, not to its prototype chain." }
</del><ins>+ { "name": "ownProperties", "optional": true, "type": "boolean", "description": "If true, returns properties belonging only to the object itself, not to its prototype chain." },
+ { "name": "ownAndGetterProperties", "optional": true, "type": "boolean", "description": "If true, returns properties belonging to the object itself, and getters in its prototype chain." }
</ins><span class="cx"> ],
</span><span class="cx"> "returns": [
</span><span class="cx"> { "name": "result", "type": "array", "items": { "$ref": "PropertyDescriptor"}, "description": "Object properties." },
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebInspectorUIChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebInspectorUI/ChangeLog (179679 => 179680)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebInspectorUI/ChangeLog        2015-02-05 08:19:19 UTC (rev 179679)
+++ branches/safari-600.1.4.15-branch/Source/WebInspectorUI/ChangeLog        2015-02-05 08:55:50 UTC (rev 179680)
</span><span class="lines">@@ -1,3 +1,28 @@
</span><ins>+2015-02-05 Lucas Forschler <lforschler@apple.com>
+
+ Merge r178768
+
+ 2015-01-20 Joseph Pecoraro <pecoraro@apple.com>
+
+ Web Inspector: Expanding event objects in console shows undefined for most values, it should have real values
+ https://bugs.webkit.org/show_bug.cgi?id=137306
+
+ Reviewed by Timothy Hatcher.
+
+ When first expanding an object, show all the object's own properties and any
+ getter properties that may be on its prototype chain. Now, we only fetch
+ own properties, for __proto__ properties.
+
+ * UserInterface/Protocol/RemoteObject.js:
+ (WebInspector.RemoteObject.prototype.getOwnProperties):
+ (WebInspector.RemoteObject.prototype.getOwnAndGetterProperties):
+ (WebInspector.RemoteObject.prototype.getAllProperties):
+ (WebInspector.RemoteObject.prototype.get hasChildren): Deleted.
+ * UserInterface/Views/ObjectPropertiesSection.js:
+ (WebInspector.ObjectPropertiesSection):
+ (WebInspector.ObjectPropertiesSection.prototype.update):
+ (WebInspector.ObjectPropertyTreeElement.prototype.onpopulate):
+
</ins><span class="cx"> 2014-07-31 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r171866. <rdar://problem/17872676>
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebInspectorUIUserInterfaceProtocolRemoteObjectjs"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js (179679 => 179680)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js        2015-02-05 08:19:19 UTC (rev 179679)
+++ branches/safari-600.1.4.15-branch/Source/WebInspectorUI/UserInterface/Protocol/RemoteObject.js        2015-02-05 08:55:50 UTC (rev 179680)
</span><span class="lines">@@ -118,15 +118,20 @@
</span><span class="cx">
</span><span class="cx"> getOwnProperties: function(callback)
</span><span class="cx"> {
</span><del>- this._getProperties(true, callback);
</del><ins>+ this._getProperties(true, false, callback);
</ins><span class="cx"> },
</span><span class="cx">
</span><ins>+ getOwnAndGetterProperties: function(callback)
+ {
+ this._getProperties(false, true, callback);
+ },
+
</ins><span class="cx"> getAllProperties: function(callback)
</span><span class="cx"> {
</span><del>- this._getProperties(false, callback);
</del><ins>+ this._getProperties(false, false, callback);
</ins><span class="cx"> },
</span><span class="cx">
</span><del>- _getProperties: function(ownProperties, callback)
</del><ins>+ _getProperties: function(ownProperties, ownAndGetterProperties, callback)
</ins><span class="cx"> {
</span><span class="cx"> if (!this._objectId) {
</span><span class="cx"> callback([]);
</span><span class="lines">@@ -152,7 +157,32 @@
</span><span class="cx"> }
</span><span class="cx"> callback(result);
</span><span class="cx"> }
</span><del>- RuntimeAgent.getProperties(this._objectId, ownProperties, remoteObjectBinder);
</del><ins>+
+ // COMPATIBILITY (iOS 8): RuntimeAgent.getProperties did not support ownerAndGetterProperties.
+ // Here we do our best to reimplement it by getting all properties and reducing them down.
+ if (ownAndGetterProperties && !RuntimeAgent.getProperties.supports("ownAndGetterProperties")) {
+ RuntimeAgent.getProperties(this._objectId, function(error, allProperties) {
+ var ownOrGetterPropertiesList = [];
+ if (allProperties) {
+ for (var property of allProperties) {
+ if (property.isOwn || property.get || property.name === "__proto__") {
+ // Own property or getter property in prototype chain.
+ ownOrGetterPropertiesList.push(property);
+ } else if (property.value && property.name !== property.name.toUpperCase()) {
+ var type = property.value.type;
+ if (type && type !== "function" && property.name !== "constructor") {
+ // Possible native binding getter property converted to a value. Also, no CONSTANT name style and not "constructor".
+ ownOrGetterPropertiesList.push(property);
+ }
+ }
+ }
+ }
+ remoteObjectBinder(error, ownOrGetterPropertiesList);
+ });
+ return;
+ }
+
+ RuntimeAgent.getProperties(this._objectId, ownProperties, ownAndGetterProperties, remoteObjectBinder);
</ins><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> setPropertyValue: function(name, value, callback)
</span></span></pre></div>
<a id="branchessafari6001415branchSourceWebInspectorUIUserInterfaceViewsObjectPropertiesSectionjs"></a>
<div class="modfile"><h4>Modified: branches/safari-600.1.4.15-branch/Source/WebInspectorUI/UserInterface/Views/ObjectPropertiesSection.js (179679 => 179680)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.1.4.15-branch/Source/WebInspectorUI/UserInterface/Views/ObjectPropertiesSection.js        2015-02-05 08:19:19 UTC (rev 179679)
+++ branches/safari-600.1.4.15-branch/Source/WebInspectorUI/UserInterface/Views/ObjectPropertiesSection.js        2015-02-05 08:55:50 UTC (rev 179680)
</span><span class="lines">@@ -23,11 +23,11 @@
</span><span class="cx"> * THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><del>-WebInspector.ObjectPropertiesSection = function(object, title, subtitle, emptyPlaceholder, ignoreHasOwnProperty, extraProperties, treeElementConstructor)
</del><ins>+WebInspector.ObjectPropertiesSection = function(object, title, subtitle, emptyPlaceholder, getAllProperties, extraProperties, treeElementConstructor)
</ins><span class="cx"> {
</span><span class="cx"> this.emptyPlaceholder = (emptyPlaceholder || WebInspector.UIString("No Properties"));
</span><span class="cx"> this.object = object;
</span><del>- this.ignoreHasOwnProperty = ignoreHasOwnProperty;
</del><ins>+ this.getAllProperties = getAllProperties;
</ins><span class="cx"> this.extraProperties = extraProperties;
</span><span class="cx"> this.treeElementConstructor = treeElementConstructor || WebInspector.ObjectPropertyTreeElement;
</span><span class="cx"> this.editable = true;
</span><span class="lines">@@ -50,10 +50,10 @@
</span><span class="cx"> return;
</span><span class="cx"> self.updateProperties(properties);
</span><span class="cx"> }
</span><del>- if (this.ignoreHasOwnProperty)
</del><ins>+ if (this.getAllProperties)
</ins><span class="cx"> this.object.getAllProperties(callback);
</span><span class="cx"> else
</span><del>- this.object.getOwnProperties(callback);
</del><ins>+ this.object.getOwnAndGetterProperties(callback);
</ins><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> updateProperties: function(properties, rootTreeElementConstructor, rootPropertyComparer)
</span><span class="lines">@@ -163,7 +163,11 @@
</span><span class="cx"> this.appendChild(new this.treeOutline.section.treeElementConstructor(properties[i]));
</span><span class="cx"> }
</span><span class="cx"> };
</span><del>- this.property.value.getOwnProperties(callback.bind(this));
</del><ins>+
+ if (this.property.name === "__proto__")
+ this.property.value.getOwnProperties(callback.bind(this));
+ else
+ this.property.value.getOwnAndGetterProperties(callback.bind(this));
</ins><span class="cx"> },
</span><span class="cx">
</span><span class="cx"> ondblclick: function(event)
</span></span></pre>
</div>
</div>
</body>
</html>