Explorar o código

Fix application shell tests.

Afshin Darian %!s(int64=8) %!d(string=hai) anos
pai
achega
52481f8aba
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/application/shell.ts

+ 4 - 1
src/application/shell.ts

@@ -327,7 +327,10 @@ class ApplicationShell extends Widget {
    * Close all widgets in the main area.
    */
   closeAll(): void {
-    each(this._dockPanel.widgets(), widget => { widget.close(); });
+    // Make a copy of all the widget in the dock panel (using `toArray()`)
+    // before removing them because removing them while iterating through them
+    // modifies the underlying data of the iterator.
+    each(toArray(this._dockPanel.widgets()), widget => { widget.close(); });
     this._save();
   }