mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-08-01 20:07:22 +02:00
Use more more optional chaining in the src/ folder
This commit is contained in:
parent
4d9007e6f9
commit
1813ab0774
@ -190,11 +190,9 @@ class Builder {
|
||||
if (hasNamespace) {
|
||||
this._currentNamespace = this._namespaceStack.pop();
|
||||
}
|
||||
if (prefixes) {
|
||||
prefixes.forEach(({ prefix }) => {
|
||||
this._namespacePrefixes.get(prefix).pop();
|
||||
});
|
||||
}
|
||||
prefixes?.forEach(({ prefix }) => {
|
||||
this._namespacePrefixes.get(prefix).pop();
|
||||
});
|
||||
if (nsAgnostic) {
|
||||
this._nsAgnosticLevel--;
|
||||
}
|
||||
|
||||
@ -43,13 +43,10 @@ class ProxyHandler {
|
||||
}
|
||||
|
||||
set(obj, prop, value) {
|
||||
if (obj._kidIds) {
|
||||
// If the field is a container for other fields then
|
||||
// dispatch the kids.
|
||||
obj._kidIds.forEach(id => {
|
||||
obj._appObjects[id].wrapped[prop] = value;
|
||||
});
|
||||
}
|
||||
// If the field is a container for other fields then dispatch the kids.
|
||||
obj._kidIds?.forEach(id => {
|
||||
obj._appObjects[id].wrapped[prop] = value;
|
||||
});
|
||||
|
||||
if (typeof prop === "string" && !prop.startsWith("_") && prop in obj) {
|
||||
const old = obj[prop];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user