(node: Node, userReactiveImport?: string)
| 1306 | } |
| 1307 | |
| 1308 | function canNeverBeRef(node: Node, userReactiveImport?: string): boolean { |
| 1309 | if (isCallOf(node, userReactiveImport)) { |
| 1310 | return true |
| 1311 | } |
| 1312 | switch (node.type) { |
| 1313 | case 'UnaryExpression': |
| 1314 | case 'BinaryExpression': |
| 1315 | case 'ArrayExpression': |
| 1316 | case 'ObjectExpression': |
| 1317 | case 'FunctionExpression': |
| 1318 | case 'ArrowFunctionExpression': |
| 1319 | case 'UpdateExpression': |
| 1320 | case 'ClassExpression': |
| 1321 | case 'TaggedTemplateExpression': |
| 1322 | return true |
| 1323 | case 'SequenceExpression': |
| 1324 | return canNeverBeRef( |
| 1325 | node.expressions[node.expressions.length - 1], |
| 1326 | userReactiveImport, |
| 1327 | ) |
| 1328 | default: |
| 1329 | if (isLiteralNode(node)) { |
| 1330 | return true |
| 1331 | } |
| 1332 | return false |
| 1333 | } |
| 1334 | } |
| 1335 | |
| 1336 | function isStaticNode(node: Node): boolean { |
| 1337 | node = unwrapTSNode(node) |
no test coverage detected