Skip to content

Commit 5086648

Browse files
committed
fix: handle ForwardRefs type
1 parent 6da2c8c commit 5086648

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);
@@ -454,6 +451,8 @@ const allocate = (container: DeserializeContainer, typeId: number, value: unknow
454451
throw qError(QError.serializeErrorCannotAllocate, ['forward ref']);
455452
}
456453
return container.$getObjectById$(container.$forwardRefs$[value as number]);
454+
case TypeIds.ForwardRefs:
455+
return value;
457456
case TypeIds.Constant:
458457
return _constants[value as Constants];
459458
case TypeIds.Number:

0 commit comments

Comments
 (0)