fix: left might be GC

This commit is contained in:
Alex Yang 2023-08-11 04:04:46 -04:00
parent 5ee6992d1f
commit 02a9302f69

View File

@ -427,9 +427,12 @@ export class Item extends AbstractStruct {
if (this.parent) {
if ((!this.left && (!this.right || this.right.left !== null)) || (this.left && this.left.right !== this.right)) {
/**
* @type {Item|null}
* @type {GC|Item|null}
*/
let left = this.left
if (left && left.constructor === GC) {
left = null
}
/**
* @type {Item|null}