mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-08-01 11:57:20 +02:00
Merge pull request #21661 from Snuffleupagus/more-optional-chaining-6
Use more more optional chaining in the `src/` folder
This commit is contained in:
commit
73707b62e9
@ -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--;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user