(ast)
| 611 | } |
| 612 | |
| 613 | isAstMathFunction(ast) { |
| 614 | const mathFunctions = [ |
| 615 | 'abs', |
| 616 | 'acos', |
| 617 | 'acosh', |
| 618 | 'asin', |
| 619 | 'asinh', |
| 620 | 'atan', |
| 621 | 'atan2', |
| 622 | 'atanh', |
| 623 | 'cbrt', |
| 624 | 'ceil', |
| 625 | 'clz32', |
| 626 | 'cos', |
| 627 | 'cosh', |
| 628 | 'expm1', |
| 629 | 'exp', |
| 630 | 'floor', |
| 631 | 'fround', |
| 632 | 'imul', |
| 633 | 'log', |
| 634 | 'log2', |
| 635 | 'log10', |
| 636 | 'log1p', |
| 637 | 'max', |
| 638 | 'min', |
| 639 | 'pow', |
| 640 | 'random', |
| 641 | 'round', |
| 642 | 'sign', |
| 643 | 'sin', |
| 644 | 'sinh', |
| 645 | 'sqrt', |
| 646 | 'tan', |
| 647 | 'tanh', |
| 648 | 'trunc', |
| 649 | ]; |
| 650 | return ast.type === 'CallExpression' && |
| 651 | ast.callee && |
| 652 | ast.callee.type === 'MemberExpression' && |
| 653 | ast.callee.object && |
| 654 | ast.callee.object.type === 'Identifier' && |
| 655 | ast.callee.object.name === 'Math' && |
| 656 | ast.callee.property && |
| 657 | ast.callee.property.type === 'Identifier' && |
| 658 | mathFunctions.indexOf(ast.callee.property.name) > -1; |
| 659 | } |
| 660 | |
| 661 | isAstVariable(ast) { |
| 662 | return ast.type === 'Identifier' || ast.type === 'MemberExpression'; |
no outgoing calls
no test coverage detected