mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 14:48:08 +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
|
@ -166,6 +166,10 @@
|
|||
"no-nested-ternary": "error",
|
||||
"no-new-object": "error",
|
||||
"no-restricted-syntax": ["error",
|
||||
{
|
||||
"selector": "BinaryExpression[operator='instanceof'][right.name='Object']",
|
||||
"message": "Use `typeof` rather than `instanceof Object`.",
|
||||
},
|
||||
{
|
||||
"selector": "CallExpression[callee.name='assert'][arguments.length!=2]",
|
||||
"message": "`assert()` must always be invoked with two arguments.",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue