chaokunyang commented on code in PR #3394:
URL: https://github.com/apache/fory/pull/3394#discussion_r3044348763


##########
javascript/packages/core/lib/gen/collection.ts:
##########
@@ -327,16 +351,28 @@ export abstract class CollectionSerializerGenerator 
extends BaseSerializerGenera
                 for (let ${idx} = 0; ${idx} < ${len}; ${idx}++) {
                     if (${this.builder.reader.readInt8()} == 
${RefFlags.NullFlag}) {
                         ${this.putAccessor(result, "null", idx)}
+                        } else {
+                        if (${elemSerializer}) {
+                            ${foryName}.incReadDepth();
+                            ${this.putAccessor(result, 
`${elemSerializer}.read(false)`, idx)}
+                            ${foryName}.decReadDepth();
                     } else {
                         ${this.innerGenerator.readWithDepth((x: any) => 
`${this.putAccessor(result, x, idx)}`, "false")}
                     }
+}
                 }
 
             } else {
                 for (let ${idx} = 0; ${idx} < ${len}; ${idx}++) {
-                    ${this.innerGenerator.readWithDepth((x: any) => 
`${this.putAccessor(result, x, idx)}`, "false")}
+                    if (${elemSerializer}) {
+                        ${foryName}.incReadDepth();
+                        ${this.putAccessor(result, 
`${elemSerializer}.read(false)`, idx)}
+                        ${foryName}.decReadDepth();
+                    } else {${this.innerGenerator.readWithDepth((x: any) => 
`${this.putAccessor(result, x, idx)}`, "false")}
                 }
             }
+}

Review Comment:
   The read path has been heavily modified with new if (${elemSerializer}) 
branches, but the brace nesting looks broken — there
     are unmatched } on lines that should be inside else blocks, and the 
indentation is inconsistent with the surrounding code.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to