mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Replace instanceof Object
with typeof
checks
Using `instanceof Object` is generally problematic, since it's not guaranteed to always do the right thing for all Objects. (I stumbled upon this while working on another patch, when I noticed that the `outlineView` was broken with workers disabled.)
This commit is contained in:
parent
d80651e572
commit
909ff8e29f
4 changed files with 7 additions and 3 deletions
|
@ -586,7 +586,7 @@ class XFAObject {
|
|||
if (Array.isArray(obj)) {
|
||||
return obj.map(x => XFAObject[_cloneAttribute](x));
|
||||
}
|
||||
if (obj instanceof Object) {
|
||||
if (typeof obj === "object" && obj !== null) {
|
||||
return Object.assign({}, obj);
|
||||
}
|
||||
return obj;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue