Skip to content

Commit 43afc3a

Browse files
committed
fix: handle ForwardRefs type
1 parent f72f7af commit 43afc3a

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

Diff for: packages/qwik/src/core/shared/shared-serialization.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,10 @@ class DeserializationHandler implements ProxyHandler<object> {
118118
}
119119

120120
const container = this.$container$;
121-
let propValue = value;
122-
if (typeId !== TypeIds.ForwardRefs) {
123-
propValue = allocate(container, typeId, value);
124-
/** We stored the reference, so now we can inflate, allowing cycles. */
125-
if (typeId >= TypeIds.Error) {
126-
propValue = inflate(container, propValue, typeId, value);
127-
}
121+
let propValue = allocate(container, typeId, value);
122+
/** We stored the reference, so now we can inflate, allowing cycles. */
123+
if (typeId >= TypeIds.Error) {
124+
propValue = inflate(container, propValue, typeId, value);
128125
}
129126

130127
Reflect.set(target, property, propValue);
@@ -460,6 +457,8 @@ const allocate = (container: DeserializeContainer, typeId: number, value: unknow
460457
throw qError(QError.serializeErrorCannotAllocate, ['forward ref']);
461458
}
462459
return container.$getObjectById$(container.$forwardRefs$[value as number]);
460+
case TypeIds.ForwardRefs:
461+
return value;
463462
case TypeIds.Constant:
464463
return _constants[value as Constants];
465464
case TypeIds.Number:

0 commit comments

Comments
 (0)