(mode string, pos int, end int)
| 6669 | } |
| 6670 | |
| 6671 | func (p *Parser) parseResolutionMode(mode string, pos int, end int) (resolutionKind core.ResolutionMode) { |
| 6672 | if mode == "import" { |
| 6673 | resolutionKind = core.ModuleKindESNext |
| 6674 | return resolutionKind |
| 6675 | } |
| 6676 | if mode == "require" { |
| 6677 | resolutionKind = core.ModuleKindCommonJS |
| 6678 | return resolutionKind |
| 6679 | } |
| 6680 | p.parseErrorAt(pos, end, diagnostics.X_resolution_mode_should_be_either_require_or_import) |
| 6681 | return resolutionKind |
| 6682 | } |
| 6683 | |
| 6684 | func (p *Parser) jsErrorAtRange(loc core.TextRange, message *diagnostics.Message, args ...any) { |
| 6685 | p.jsDiagnostics = append(p.jsDiagnostics, ast.NewDiagnostic(nil, core.NewTextRange(scanner.SkipTrivia(p.sourceText, loc.Pos()), loc.End()), message, args...)) |
no test coverage detected