(input)
| 756 | const startsWithBraceRegExp = /^\s*{/; |
| 757 | const endsWithSemicolonRegExp = /;\s*$/; |
| 758 | function isValidSyntax(input) { |
| 759 | try { |
| 760 | AcornParser.parse(input, { |
| 761 | ecmaVersion: 'latest', |
| 762 | allowAwaitOutsideFunction: true, |
| 763 | }); |
| 764 | return true; |
| 765 | } catch { |
| 766 | try { |
| 767 | AcornParser.parse(`_=${input}`, { |
| 768 | ecmaVersion: 'latest', |
| 769 | allowAwaitOutsideFunction: true, |
| 770 | }); |
| 771 | return true; |
| 772 | } catch { |
| 773 | return false; |
| 774 | } |
| 775 | } |
| 776 | } |
| 777 | |
| 778 | /** |
| 779 | * Checks if some provided code represents an object literal. |
no test coverage detected
searching dependent graphs…