Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: Source/devtools/front_end/sdk/RemoteObject.js

Issue 844563003: DevTools: Fix console not showing array items inherited from prototype. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/console/ConsoleViewMessage.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 return "null"; 183 return "null";
184 184
185 var type = typeof remoteObject; 185 var type = typeof remoteObject;
186 if (type !== "object" && type !== "function") 186 if (type !== "object" && type !== "function")
187 return type; 187 return type;
188 188
189 return remoteObject.type; 189 return remoteObject.type;
190 } 190 }
191 191
192 /** 192 /**
193 * @param {!WebInspector.RemoteObject|!RuntimeAgent.RemoteObject|!RuntimeAgent.O bjectPreview} object
194 * @return {number}
195 */
196 WebInspector.RemoteObject.arrayLength = function(object)
197 {
198 if (object.subtype !== "array")
199 return 0;
200 var matches = object.description.match(/\[([0-9]+)\]/);
201 if (!matches)
202 return 0;
203 return parseInt(matches[1], 10);
204 }
205
206 /**
193 * @param {!RuntimeAgent.RemoteObject|!WebInspector.RemoteObject|number|string|b oolean|undefined|null} object 207 * @param {!RuntimeAgent.RemoteObject|!WebInspector.RemoteObject|number|string|b oolean|undefined|null} object
194 * @return {!RuntimeAgent.CallArgument} 208 * @return {!RuntimeAgent.CallArgument}
195 */ 209 */
196 WebInspector.RemoteObject.toCallArgument = function(object) 210 WebInspector.RemoteObject.toCallArgument = function(object)
197 { 211 {
198 var type = typeof object; 212 var type = typeof object;
199 var value = object; 213 var value = object;
200 var objectId = undefined; 214 var objectId = undefined;
201 var description = String(object); 215 var description = String(object);
202 216
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 return; 631 return;
618 this._runtimeAgent.releaseObject(this._objectId); 632 this._runtimeAgent.releaseObject(this._objectId);
619 }, 633 },
620 634
621 /** 635 /**
622 * @override 636 * @override
623 * @return {number} 637 * @return {number}
624 */ 638 */
625 arrayLength: function() 639 arrayLength: function()
626 { 640 {
627 if (this.subtype !== "array") 641 return WebInspector.RemoteObject.arrayLength(this);
628 return 0;
629
630 var matches = this._description.match(/\[([0-9]+)\]/);
631 if (!matches)
632 return 0;
633 return parseInt(matches[1], 10);
634 }, 642 },
635 643
636 /** 644 /**
637 * @override 645 * @override
638 * @return {!WebInspector.Target} 646 * @return {!WebInspector.Target}
639 */ 647 */
640 target: function() 648 target: function()
641 { 649 {
642 return this._target; 650 return this._target;
643 }, 651 },
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
1185 { 1193 {
1186 if (!this._cachedDescription) { 1194 if (!this._cachedDescription) {
1187 var children = this._children(); 1195 var children = this._children();
1188 this._cachedDescription = "{" + this._formatValue(children[0].value) + " => " + this._formatValue(children[1].value) + "}"; 1196 this._cachedDescription = "{" + this._formatValue(children[0].value) + " => " + this._formatValue(children[1].value) + "}";
1189 } 1197 }
1190 return this._cachedDescription; 1198 return this._cachedDescription;
1191 }, 1199 },
1192 1200
1193 __proto__: WebInspector.LocalJSONObject.prototype 1201 __proto__: WebInspector.LocalJSONObject.prototype
1194 } 1202 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/console/ConsoleViewMessage.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698