Diff
Modified: branches/chromium/1312/LayoutTests/inspector/console/command-line-api-expected.txt (136039 => 136040)
--- branches/chromium/1312/LayoutTests/inspector/console/command-line-api-expected.txt 2012-11-28 20:05:47 UTC (rev 136039)
+++ branches/chromium/1312/LayoutTests/inspector/console/command-line-api-expected.txt 2012-11-28 20:12:38 UTC (rev 136040)
@@ -1,4 +1,4 @@
-CONSOLE MESSAGE: line 1020: The console function $() has changed from $=getElementById(id) to $=querySelector(selector). You might try $("#%s")
+CONSOLE MESSAGE: line 1029: The console function $() has changed from $=getElementById(id) to $=querySelector(selector). You might try $("#%s")
Tests that command line api works.
Modified: branches/chromium/1312/LayoutTests/inspector/console/command-line-api-inspect-expected.txt (136039 => 136040)
--- branches/chromium/1312/LayoutTests/inspector/console/command-line-api-inspect-expected.txt 2012-11-28 20:05:47 UTC (rev 136039)
+++ branches/chromium/1312/LayoutTests/inspector/console/command-line-api-inspect-expected.txt 2012-11-28 20:12:38 UTC (rev 136040)
@@ -14,26 +14,26 @@
WebInspector.inspect called with: Database
WebInspector.inspect's hints are: ["databaseId"]
-inspect(db) = Database
+inspect(db) = Database {version: "1.0", transaction: function, readTransaction: function, changeVersion: function}
Running: testRevealDatabase2
WebInspector.inspect called with: Database
WebInspector.inspect's hints are: ["databaseId"]
-inspect(db2) = Database
+inspect(db2) = Database {version: "1.0", transaction: function, readTransaction: function, changeVersion: function}
Running: testRevealLocalStorage
WebInspector.inspect called with: Storage
WebInspector.inspect's hints are: ["domStorageId"]
-inspect(localStorage) = Storage
+inspect(localStorage) = Storage {}
Running: testRevealSessionStorage
WebInspector.inspect called with: Storage
WebInspector.inspect's hints are: ["domStorageId"]
-inspect(sessionStorage) = Storage
+inspect(sessionStorage) = Storage {}
Modified: branches/chromium/1312/LayoutTests/inspector/console/console-format-collections-expected.txt (136039 => 136040)
--- branches/chromium/1312/LayoutTests/inspector/console/console-format-collections-expected.txt 2012-11-28 20:05:47 UTC (rev 136039)
+++ branches/chromium/1312/LayoutTests/inspector/console/console-format-collections-expected.txt 2012-11-28 20:12:38 UTC (rev 136040)
@@ -27,12 +27,12 @@
Array[2] console-format-collections.html:41
NonArrayWithLength console-format-collections.html:44
Arguments[2] console-format-collections.html:51
-[<select>] console-format-collections.html:15
- console-format-collections.html:19
-[<option>, <option>, selectedIndex: 0] console-format-collections.html:23
- console-format-collections.html:27
- console-format-collections.html:31
-[<input>, <input>] console-format-collections.html:35
+[<select>, item: function] console-format-collections.html:15
+[<script>, <script>, <script>, item: function, namedItem: function] console-format-collections.html:19
+[<option>, <option>, selectedIndex: 0, remove: function, add: function, item: function, namedItem: function] console-format-collections.html:23
+[<html>, <head>, <script>, <script>, <script>, <body>, <p>, <div>, <form>, <select>, <option>, <option>, <input>, <input>, namedItem: function, tags: function, item: function] console-format-collections.html:27
+[<select>, <input>, <input>, item: function, namedItem: function] console-format-collections.html:31
+[<input>, <input>, item: function] console-format-collections.html:35
[1, Array[2]] console-format-collections.html:41
NonArrayWithLength {keys: Array[0]} console-format-collections.html:44
[1, "2"] console-format-collections.html:51
Modified: branches/chromium/1312/LayoutTests/inspector/console/console-format-expected.txt (136039 => 136040)
--- branches/chromium/1312/LayoutTests/inspector/console/console-format-expected.txt 2012-11-28 20:05:47 UTC (rev 136039)
+++ branches/chromium/1312/LayoutTests/inspector/console/console-format-expected.txt 2012-11-28 20:12:38 UTC (rev 136040)
@@ -48,6 +48,12 @@
CONSOLE MESSAGE: line 55: -Infinity
CONSOLE MESSAGE: line 54: test,test2,,,test4,,,,,
CONSOLE MESSAGE: line 55: test,test2,,,test4,,,,,
+CONSOLE MESSAGE: line 54: [object Object]
+CONSOLE MESSAGE: line 55: [object Object]
+CONSOLE MESSAGE: line 54: function () {}
+CONSOLE MESSAGE: line 55: function () {}
+CONSOLE MESSAGE: line 54: [object Object]
+CONSOLE MESSAGE: line 55: [object Object]
Tests that console logging dumps proper messages.
Message format number 1, 2 and 3.5 console-format.html:12
@@ -72,24 +78,22 @@
["test named "test""] console-format.html:55
globals[3]
"test named "test""
-Error console-format.html:54
+Error {} console-format.html:54
[Error] console-format.html:55
globals[4]
-Error
+Error {}
<p id="p">Tests that console logging dumps proper messages.</p> console-format.html:54
[<p>] console-format.html:55
globals[5]
<p id="p">Tests that console logging dumps proper messages.</p>
function () { return 1; } console-format.html:54
-[function () { return 1; }] console-format.html:55
+[function] console-format.html:55
globals[6]
function () { return 1; }
function () {
return 2;
} console-format.html:54
-[function () {
- return 2;
- }] console-format.html:55
+[function] console-format.html:55
globals[7]
function () {
return 2;
@@ -122,10 +126,10 @@
[id] console-format.html:55
globals[14]
id="x""x"
-Object console-format.html:54
+Object {} console-format.html:54
[Object] console-format.html:55
globals[15]
-Object
+Object {}
NaN console-format.html:54
[NaN] console-format.html:55
globals[16]
@@ -142,4 +146,16 @@
[Array[10]] console-format.html:55
globals[19]
["test", "test2", undefined × 2, "test4", undefined × 5]
+Object {} console-format.html:54
+[Object] console-format.html:55
+globals[20]
+Object {}
+[function] console-format.html:54
+[Array[1]] console-format.html:55
+globals[21]
+[function () {}]
+Object {bar: "bar", foo: "foo"} console-format.html:54
+[Object] console-format.html:55
+globals[22]
+Object {bar: "bar", foo: "foo"}
Modified: branches/chromium/1312/LayoutTests/inspector/console/console-format.html (136039 => 136040)
--- branches/chromium/1312/LayoutTests/inspector/console/console-format.html 2012-11-28 20:05:47 UTC (rev 136039)
+++ branches/chromium/1312/LayoutTests/inspector/console/console-format.html 2012-11-28 20:12:38 UTC (rev 136040)
@@ -12,6 +12,9 @@
console.log('Message format number %i, %d and %f', 1, 2, 3.5);
console.log('Message %s for %s', 'format', 'string');
console.log('Object %o', {'foo' : 'bar' });
+ var foo = { foo: "foo"};
+ var bar = { bar: "bar" };
+ bar.__proto__ = foo;
var array = ["test", "test2"]; array.length = 10;
array.foo = {};
@@ -43,7 +46,7 @@
globals = [
regex1, regex2, str, str2, error, node, func, multilinefunc, num, linkify,
null, undefined, valuelessAttribute, valuedAttribute, existingAttribute, throwingLengthGetter,
- NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, array
+ NaN, Number.POSITIVE_INFINITY, Number.NEGATIVE_INFINITY, array, {}, [function() {}], bar
];
runTest();
Copied: branches/chromium/1312/LayoutTests/platform/chromium/inspector/console/command-line-api-inspect-expected.txt (from rev 134053, trunk/LayoutTests/platform/chromium/inspector/console/command-line-api-inspect-expected.txt) (0 => 136040)
--- branches/chromium/1312/LayoutTests/platform/chromium/inspector/console/command-line-api-inspect-expected.txt (rev 0)
+++ branches/chromium/1312/LayoutTests/platform/chromium/inspector/console/command-line-api-inspect-expected.txt 2012-11-28 20:12:38 UTC (rev 136040)
@@ -0,0 +1,39 @@
+Tests that inspect() command line api works.
+
+
+Running: testRevealElement
+
+
+WebInspector.inspect called with: <p>
+WebInspector.inspect's hints are: []
+inspect($('#p1')) =
+Selected node id: 'p1'.
+
+Running: testRevealDatabase
+
+
+WebInspector.inspect called with: Database
+WebInspector.inspect's hints are: ["databaseId"]
+inspect(db) = Database {version: "1.0", changeVersion: function, transaction: function, readTransaction: function}
+
+Running: testRevealDatabase2
+
+
+WebInspector.inspect called with: Database
+WebInspector.inspect's hints are: ["databaseId"]
+inspect(db2) = Database {version: "1.0", changeVersion: function, transaction: function, readTransaction: function}
+
+Running: testRevealLocalStorage
+
+
+WebInspector.inspect called with: Storage
+WebInspector.inspect's hints are: ["domStorageId"]
+inspect(localStorage) = Storage {}
+
+Running: testRevealSessionStorage
+
+
+WebInspector.inspect called with: Storage
+WebInspector.inspect's hints are: ["domStorageId"]
+inspect(sessionStorage) = Storage {}
+
Modified: branches/chromium/1312/LayoutTests/platform/chromium/inspector/console/console-format-collections-expected.txt (136039 => 136040)
--- branches/chromium/1312/LayoutTests/platform/chromium/inspector/console/console-format-collections-expected.txt 2012-11-28 20:05:47 UTC (rev 136039)
+++ branches/chromium/1312/LayoutTests/platform/chromium/inspector/console/console-format-collections-expected.txt 2012-11-28 20:12:38 UTC (rev 136040)
@@ -27,12 +27,12 @@
Array[2] console-format-collections.html:41
NonArrayWithLength console-format-collections.html:44
Arguments[2] console-format-collections.html:51
-[<select>] console-format-collections.html:15
-[<script>, <script>, <script>] console-format-collections.html:19
-[<option>, <option>, selectedIndex: 0] console-format-collections.html:23
-[<html>, <head>, <script>, <script>, <script>, <body>, <p>, <div>, <form>, <select>, <option>, <option>, <input>, <input>] console-format-collections.html:27
-[<select>, <input>, <input>] console-format-collections.html:31
-[<input>, <input>] console-format-collections.html:35
+[<select>, item: function] console-format-collections.html:15
+[<script>, <script>, <script>, item: function, namedItem: function] console-format-collections.html:19
+[<option>, <option>, selectedIndex: 0, add: function, remove: function, item: function, namedItem: function] console-format-collections.html:23
+[<html>, <head>, <script>, <script>, <script>, <body>, <p>, <div>, <form>, <select>, <option>, <option>, <input>, <input>, item: function, namedItem: function, tags: function] console-format-collections.html:27
+[<select>, <input>, <input>, item: function, namedItem: function] console-format-collections.html:31
+[<input>, <input>, item: function] console-format-collections.html:35
[1, Array[2]] console-format-collections.html:41
NonArrayWithLength {keys: Array[0]} console-format-collections.html:44
[1, "2"] console-format-collections.html:51
Modified: branches/chromium/1312/Source/WebCore/inspector/InjectedScriptSource.js (136039 => 136040)
--- branches/chromium/1312/Source/WebCore/inspector/InjectedScriptSource.js 2012-11-28 20:05:47 UTC (rev 136039)
+++ branches/chromium/1312/Source/WebCore/inspector/InjectedScriptSource.js 2012-11-28 20:12:38 UTC (rev 136040)
@@ -803,35 +803,45 @@
*/
_generatePreview: function(object)
{
- var preview = {};
+ this.preview = {};
+ this.preview.lossless = true;
+ this.preview.overflow = false;
+ this.preview.properties = [];
+
var isArray = this.subtype === "array";
var elementsToDump = isArray ? 100 : 5;
-
- var propertyNames = Object.getOwnPropertyNames(/** @type {!Object} */(object));
- preview.lossless = true;
- preview.overflow = false;
- var properties = preview.properties = [];
+ for (var o = object; injectedScript._isDefined(o); o = o.__proto__)
+ this._generateProtoPreview(o, elementsToDump);
+ },
+
+ /**
+ * @param {Object} object
+ * @param {number} elementsToDump
+ */
+ _generateProtoPreview: function(object, elementsToDump)
+ {
+ var propertyNames = Object.keys(/** @type {!Object} */(object));
try {
for (var i = 0; i < propertyNames.length; ++i) {
- if (properties.length >= elementsToDump) {
- preview.overflow = true;
- preview.lossless = false;
+ if (this.preview.properties.length >= elementsToDump) {
+ this.preview.overflow = true;
+ this.preview.lossless = false;
break;
}
var name = propertyNames[i];
- if (isArray && name === "length")
+ if (this.subtype === "array" && name === "length")
continue;
var descriptor = Object.getOwnPropertyDescriptor(/** @type {!Object} */(object), name);
if (!("value" in descriptor) || !descriptor.enumerable) {
- preview.lossless = false;
+ this.preview.lossless = false;
continue;
}
var value = descriptor.value;
if (value === null) {
- properties.push({ name: name, type: "object", value: "null" });
+ this.preview.properties.push({ name: name, type: "object", value: "null" });
continue;
}
@@ -842,27 +852,26 @@
if (type === "string") {
if (value.length > maxLength) {
value = this._abbreviateString(value, maxLength, true);
- preview.lossless = false;
+ this.preview.lossless = false;
}
value = "\"" + value.replace(/\n/g, "\u21B5") + "\"";
}
- properties.push({ name: name, type: type, value: value + "" });
+ this.preview.properties.push({ name: name, type: type, value: value + "" });
continue;
}
- preview.lossless = false;
+ this.preview.lossless = false;
- if (type === "function")
- continue;
+ var subtype = injectedScript._subtype(value);
+ var description = "";
+ if (type !== "function")
+ description = this._abbreviateString(/** @type {string} */ (injectedScript._describe(value)), maxLength, subtype === "regexp");
- var subtype = injectedScript._subtype(value);
- var property = { name: name, type: type, value: this._abbreviateString(/** @type {string} */ (injectedScript._describe(value)), maxLength, subtype === "regexp") };
+ var property = { name: name, type: type, value: description };
if (subtype)
property.subtype = subtype;
- properties.push(property);
+ this.preview.properties.push(property);
}
- if (properties.length)
- this.preview = preview;
} catch (e) {
}
},
Modified: branches/chromium/1312/Source/WebCore/inspector/front-end/ConsoleMessage.js (136039 => 136040)
--- branches/chromium/1312/Source/WebCore/inspector/front-end/ConsoleMessage.js 2012-11-28 20:05:47 UTC (rev 136039)
+++ branches/chromium/1312/Source/WebCore/inspector/front-end/ConsoleMessage.js 2012-11-28 20:12:38 UTC (rev 136040)
@@ -324,8 +324,11 @@
span.addStyleClass("console-formatted-preview-node");
else if (property.subtype === "regexp")
span.addStyleClass("console-formatted-string");
- }
- span.textContent = property.value;
+ span.textContent = property.value;
+ } else if (property.type === "function")
+ span.textContent = "function";
+ else
+ span.textContent = property.value;
}
if (preview.overflow)
titleElement.createChild("span").textContent = "\u2026";