( operand: Node, parent: Node | undefined, module: SourceModule )
| 1220 | (parent?.type === "BinaryExpression" && isEqualityOperator(parent.operator)) |
| 1221 | |
| 1222 | const isPrototypeMutatorCall = ( |
| 1223 | operand: Node, |
| 1224 | parent: Node | undefined, |
| 1225 | module: SourceModule |
| 1226 | ): boolean => { |
| 1227 | if (parent?.type !== "CallExpression" || parent.arguments[0] !== operand) |
| 1228 | return false |
| 1229 | const callee = unwrapExpression(parent.callee) |
| 1230 | const name = globalNameOf(callee, module) |
| 1231 | if (name && prototypeMutators.has(name)) return true |
| 1232 | if (callee.type !== "MemberExpression") return false |
| 1233 | const method = memberNameOf(callee) |
| 1234 | const owner = unwrapExpression(callee.object) |
| 1235 | if ( |
| 1236 | typeof method !== "string" || |
| 1237 | owner.type !== "MemberExpression" || |
| 1238 | !isGlobalHost(owner.object, module) |
| 1239 | ) |
| 1240 | return false |
| 1241 | const ownerName = memberNameOf(owner) |
| 1242 | return ( |
| 1243 | typeof ownerName === "string" && |
| 1244 | prototypeMutators.has(`${ownerName}.${method}`) |
| 1245 | ) |
| 1246 | } |
| 1247 | |
| 1248 | const isArrayOrObjectLiteral = (node: Node | undefined): boolean => { |
| 1249 | if (!node) return false |
no test coverage detected