checkStrictEmptySemicolon returns an error if strict mode is enabled and a bare semicolon is encountered.
()
| 839 | |
| 840 | // checkStrictEmptySemicolon returns an error if strict mode is enabled and a bare semicolon is encountered. |
| 841 | func (p *Parser) checkStrictEmptySemicolon() error { |
| 842 | if p.strict { |
| 843 | return goerrors.InvalidSyntaxError( |
| 844 | "empty statement not allowed in strict mode", |
| 845 | p.currentLocation(), |
| 846 | "remove extra semicolons or disable strict mode", |
| 847 | ) |
| 848 | } |
| 849 | return nil |
| 850 | } |
| 851 | |
| 852 | // advance moves to the next token |
| 853 | func (p *Parser) advance() { |
no test coverage detected