Merge pull request #21661 from Snuffleupagus/more-optional-chaining-6

Use more more optional chaining in the `src/` folder
This commit is contained in:
Jonas Jenwald 2026-07-30 10:35:17 +02:00 committed by GitHub
commit 73707b62e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 12 deletions

View File

@ -190,11 +190,9 @@ class Builder {
if (hasNamespace) { if (hasNamespace) {
this._currentNamespace = this._namespaceStack.pop(); this._currentNamespace = this._namespaceStack.pop();
} }
if (prefixes) { prefixes?.forEach(({ prefix }) => {
prefixes.forEach(({ prefix }) => {
this._namespacePrefixes.get(prefix).pop(); this._namespacePrefixes.get(prefix).pop();
}); });
}
if (nsAgnostic) { if (nsAgnostic) {
this._nsAgnosticLevel--; this._nsAgnosticLevel--;
} }

View File

@ -43,13 +43,10 @@ class ProxyHandler {
} }
set(obj, prop, value) { set(obj, prop, value) {
if (obj._kidIds) { // If the field is a container for other fields then dispatch the kids.
// If the field is a container for other fields then obj._kidIds?.forEach(id => {
// dispatch the kids.
obj._kidIds.forEach(id => {
obj._appObjects[id].wrapped[prop] = value; obj._appObjects[id].wrapped[prop] = value;
}); });
}
if (typeof prop === "string" && !prop.startsWith("_") && prop in obj) { if (typeof prop === "string" && !prop.startsWith("_") && prop in obj) {
const old = obj[prop]; const old = obj[prop];