Skip to content

Commit 442273b

Browse files
authored
Merge pull request #7862 from QwikDev/serdes-fix-inflate
fix(serdes): correctly set allocated value before inflating
2 parents 33a15ac + a0ad346 commit 442273b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

packages/qwik/src/core/shared/shared-serialization.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -128,15 +128,18 @@ class DeserializationHandler implements ProxyHandler<object> {
128128

129129
const container = this.$container$;
130130
let propValue = allocate(container, typeId, value);
131-
/** We stored the reference, so now we can inflate, allowing cycles. */
132-
if (typeId >= TypeIds.Error) {
133-
propValue = inflate(container, propValue, typeId, value);
134-
}
135131

136132
Reflect.set(target, property, propValue);
137133
this.$data$[idx] = undefined;
138134
this.$data$[idx + 1] = propValue;
139135

136+
/** We stored the reference, so now we can inflate, allowing cycles. */
137+
if (typeId >= TypeIds.Error) {
138+
propValue = inflate(container, propValue, typeId, value);
139+
Reflect.set(target, property, propValue);
140+
this.$data$[idx + 1] = propValue;
141+
}
142+
140143
return propValue;
141144
}
142145

0 commit comments

Comments
 (0)