Left: | ||
Right: |
OLD | NEW |
---|---|
1 /* | 1 /* |
2 * This Source Code is subject to the terms of the Mozilla Public License | 2 * This Source Code is subject to the terms of the Mozilla Public License |
3 * version 2.0 (the "License"). You can obtain a copy of the License at | 3 * version 2.0 (the "License"). You can obtain a copy of the License at |
4 * http://mozilla.org/MPL/2.0/. | 4 * http://mozilla.org/MPL/2.0/. |
5 */ | 5 */ |
6 | 6 |
7 let EXPORTED_SYMBOLS = ["shutdown", "getNodeInfo", "togglePreview", | 7 let EXPORTED_SYMBOLS = ["shutdown", "getNodeInfo", "togglePreview", |
8 "forgetNode"]; | 8 "forgetNode"]; |
9 | 9 |
10 const Ci = Components.interfaces; | 10 const Ci = Components.interfaces; |
11 const Cu = Components.utils; | 11 const Cu = Components.utils; |
12 | 12 |
13 let {console} = Cu.import("resource://gre/modules/devtools/Console.jsm", {}); | 13 let {console} = Cu.import("resource://gre/modules/devtools/Console.jsm", {}); |
14 let {DebuggerServer} = Cu.import("resource://gre/modules/devtools/dbg-server.jsm ", {}); | 14 let {DebuggerServer} = Cu.import("resource://gre/modules/devtools/dbg-server.jsm ", {}); |
15 let {Services} = Cu.import("resource://gre/modules/Services.jsm", {}); | 15 let {Services} = Cu.import("resource://gre/modules/Services.jsm", {}); |
16 | 16 |
17 let processID = Services.appinfo.processID; | 17 let processID = Services.appinfo.processID; |
18 let maxNodeID = 0; | 18 let maxNodeID = 0; |
19 let nodes = new Map(); | 19 let nodes = new Map(); |
20 | 20 |
21 let name = "elemhidehelper"; | 21 let name = "elemhidehelper"; |
22 let actor = { | 22 let actor = { |
23 constructorFun: Actor, | 23 constructorFun: Actor, |
24 constructorName: name, | 24 constructorName: name, |
25 name: name | 25 name: name |
26 }; | 26 }; |
27 | 27 |
28 DebuggerServer.addTabActor(actor, name); | 28 DebuggerServer.addTabActor(actor, name); |
29 | 29 |
30 let shutdown = (function() | 30 var shutdown = (function() |
saroyanm
2015/12/21 13:45:18
What is the reason of using "var" here ?
Wladimir Palant
2015/12/21 19:01:59
As I said, the problem here is https://bugzilla.mo
saroyanm
2015/12/23 10:55:34
Got it.
| |
31 { | 31 { |
32 let executed = false; | 32 let executed = false; |
33 return function() | 33 return function() |
34 { | 34 { |
35 if (!executed) | 35 if (!executed) |
36 { | 36 { |
37 executed = true; | 37 executed = true; |
38 try | 38 try |
39 { | 39 { |
40 DebuggerServer.removeTabActor(actor); | 40 DebuggerServer.removeTabActor(actor); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
162 // forget this node then. | 162 // forget this node then. |
163 forgetNode(nodeID); | 163 forgetNode(nodeID); |
164 } | 164 } |
165 } | 165 } |
166 } | 166 } |
167 | 167 |
168 function forgetNode(nodeID) | 168 function forgetNode(nodeID) |
169 { | 169 { |
170 nodes.delete(nodeID); | 170 nodes.delete(nodeID); |
171 } | 171 } |
OLD | NEW |