Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function loadState(state) {
if (!state || state.version === undefined) return false;
switch (state.version) {
case 1:
state.filterAsm = {};
state.version = 2;
/* falls through */
case 2:
state.compilers = [state];
state.version = 3;
/* falls through */
case 3:
state = convertOldState(state);
break; // no fall through
case 4:
state = GoldenLayout.unminifyConfig(state);
break;
default:
throw new Error("Invalid version '" + state.version + "'");
}
return state;
}