martin-g commented on code in PR #3466:
URL: https://github.com/apache/avro/pull/3466#discussion_r2408383684
##########
lang/js/lib/schemas.js:
##########
@@ -2029,9 +2029,20 @@ 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 || {};
+ // Create a new opts object if namespace would change to avoid modifying
shared state
+ if (attrs.namespace && attrs.namespace !== opts.namespace) {
Review Comment:
IMO it would be better to always return a new opts object.
--
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]