Bug 1780372 - Fix a failure in browser_ext_sessions_getRecentlyClosed.js.

MANUAL PUSH: Trivial fixup CLOSED TREE
This commit is contained in:
Emilio Cobos Álvarez
2022-07-22 02:17:27 +02:00
parent 6e31ba216c
commit b2f89efc95

View File

@@ -1009,11 +1009,16 @@ class Window extends WindowBase {
}
static getState(window) {
// NOTE(emilio): This is quite subtle: when instead of a Window object we
// get a windowData (like when using convertFromSessionStoreClosedData), we
// don't have the relevant properties in the object, so we end up doing
// { [undefined]: ..., }[undefined], so it's important that "normal" is the
// last property. We should do this more explicitly, probably.
const STATES = {
[window.STATE_MAXIMIZED]: "maximized",
[window.STATE_MINIMIZED]: "minimized",
[window.STATE_NORMAL]: "normal",
[window.STATE_FULLSCREEN]: "fullscreen",
[window.STATE_NORMAL]: "normal",
};
return STATES[window.windowState];
}