MCPcopy Index your code
hub / github.com/Moddable-OpenSource/moddable / selectMachine

Method selectMachine

tools/xsbug/main.js:244–272  ·  view source on GitHub ↗
(machine, tab = 0)

Source from the content-addressed store, hash-verified

242 }
243 // onDisplaying deferred to onAppearanceChanged so that appearance is known
244 selectMachine(machine, tab = 0) {
245 if ((this.currentMachine != machine) || (this.currentTab != tab)) {
246 application.distribute("onMachineDeselected", this.currentMachine, this.currentTab);
247 let container = this.FEATURE;
248 if (machine) {
249 if (!this.currentMachine)
250 container.replace(container.first, new DebugPane(this));
251 }
252 else {
253 if ((this.currentMachine) || (this.currentTab != tab)) {
254 if (tab == 0)
255 container.replace(container.first, new FilePane(this));
256 else if (tab == 1) {
257 container.replace(container.first, new MessagePane(this));
258// application.distribute("onBubblesChanged", items);
259 }
260 else if (tab == 2)
261 container.replace(container.first, new ProfilePane(this));
262 else if (tab == 3)
263 container.replace(container.first, new SerialPane(this));
264 else
265 container.replace(container.first, new Test262Pane(this));
266 }
267 }
268 this.currentMachine = machine
269 this.currentTab = tab
270 application.distribute("onMachineSelected", machine, tab);
271 }
272 }
273 showTab(tab, showIt) {
274 if (this.visibleTabs[tab] != showIt) {
275 if (this.currentTab == tab)

Callers 9

showTabMethod · 0.95
doOpenFileCallbackMethod · 0.95
selectMethod · 0.80
selectMethod · 0.80
selectMethod · 0.80
selectMethod · 0.80
selectMethod · 0.80
selectMethod · 0.80
DebugBehavior.jsFile · 0.80

Calls 2

distributeMethod · 0.80
replaceMethod · 0.80

Tested by

no test coverage detected