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

Side by Side Diff: sky/framework/inspector/dom-agent.sky

Issue 821643007: Fix inspector unittests. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Fix uninitialized field 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
« no previous file with comments | « no previous file | 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 <script> 1 <script>
2 class DOMAgent { 2 class DOMAgent {
3 constructor(delegate) { 3 constructor(delegate) {
4 this.enabled = false; 4 this.enabled = false;
5 this.delegate_ = delegate; 5 this.delegate_ = delegate;
6 this.nextNodeId_ = 1; 6 this.nextNodeId_ = 1;
7 this.nodeToId_ = new Map(); 7 this.nodeToId_ = new Map();
8 this.idToNode_ = new Map(); 8 this.idToNode_ = new Map();
9 this.observer_ = null;
9 Object.preventExtensions(this); 10 Object.preventExtensions(this);
10 } 11 }
11 12
12 getIdForNode_(node) { 13 getIdForNode_(node) {
13 if (this.nodeToId_.has(node)) 14 if (this.nodeToId_.has(node))
14 return this.nodeToId_.get(node); 15 return this.nodeToId_.get(node);
15 var id = this.nextNodeId_++; 16 var id = this.nextNodeId_++;
16 this.nodeToId_.set(node, id); 17 this.nodeToId_.set(node, id);
17 this.idToNode_.set(id, node); 18 this.idToNode_.set(id, node);
18 return id; 19 return id;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 node: this.serializeNode_(node), 164 node: this.serializeNode_(node),
164 }); 165 });
165 }.bind(this)); 166 }.bind(this));
166 } 167 }
167 } 168 }
168 } 169 }
169 } 170 }
170 171
171 module.exports = DOMAgent; 172 module.exports = DOMAgent;
172 </script> 173 </script>
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698