martin-g commented on code in PR #3466:
URL: https://github.com/apache/avro/pull/3466#discussion_r2417466183
##########
lang/js/lib/schemas.js:
##########
@@ -2029,10 +2029,23 @@ function getOpts(attrs, opts) {
throw new Error('invalid type: null (did you mean "null"?)');
}
opts = opts || {};
- opts.registry = opts.registry || {};
- opts.namespace = attrs.namespace || opts.namespace;
- opts.logicalTypes = opts.logicalTypes || {};
- return opts;
+
+ // Ensure registry and logicalTypes exist and are preserved by reference so
+ // type definitions can accumulate across recursive calls.
+ if (!opts.registry) {
Review Comment:
Any reason not to unline it below as: 'xyz: opts.xyz || {}' ?
--
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]