saveload: Remove reference replacer from the replacer. It must now crash every time there is a circular reference
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Siklos 2022-08-18 16:26:43 +02:00
parent c3e2eaf8a8
commit 7d7d627ab8

View file

@ -42,7 +42,6 @@ export function Revive(editorState: IEditorState): void {
}
export const getCircularReplacer = (): (key: any, value: object | null) => object | null | undefined => {
const seen = new WeakSet();
return (key: any, value: object | null) => {
if (key === 'parent') {
return;
@ -52,12 +51,6 @@ export const getCircularReplacer = (): (key: any, value: object | null) => objec
return;
}
if (typeof value === 'object' && value !== null) {
if (seen.has(value)) {
return;
}
seen.add(value);
}
return value;
};
};