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

Unified Diff: Source/devtools/front_end/DOMAgent.js

Issue 26586002: [devtools] Return empty array from DOMNode.children() rather than null. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Provisional fix. Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/inspector/elements/inspect-deep-shadow-element.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/DOMAgent.js
diff --git a/Source/devtools/front_end/DOMAgent.js b/Source/devtools/front_end/DOMAgent.js
index 45467bc785d2b124fa86413c1df121a4feaaf940..4e3d2bbb83a4126eb143c79f799132d2d8ef0172 100644
--- a/Source/devtools/front_end/DOMAgent.js
+++ b/Source/devtools/front_end/DOMAgent.js
@@ -352,6 +352,11 @@ WebInspector.DOMNode.prototype = {
*/
function mycallback(error)
{
+ if (!this._children) {
+ // By this moment children should have been pushed in case there were any.
+ // Fall back for nodes with no children.
+ this._children = [];
+ }
if (callback)
callback(error ? null : this.children());
}
« no previous file with comments | « LayoutTests/inspector/elements/inspect-deep-shadow-element.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698