Fixed a printer crash caused by empty parameter modifiers

This commit is contained in:
Mateusz Burzyński 2024-11-19 12:28:06 +01:00
Родитель b3c67d3202
Коммит d1d4f39130
2 изменённых файлов: 32 добавлений и 1 удалений

Просмотреть файл

@ -1114,7 +1114,7 @@ export function createSyntacticTypeNodeBuilder(
function ensureParameter(p: ParameterDeclaration, context: SyntacticTypeNodeBuilderContext) {
return factory.updateParameterDeclaration(
p,
[],
p.modifiers,
reuseNode(context, p.dotDotDotToken),
resolver.serializeNameOfParameter(context, p),
resolver.isOptionalParameter(p) ? factory.createToken(SyntaxKind.QuestionToken) : undefined,

Просмотреть файл

@ -0,0 +1,31 @@
///<reference path="fourslash.ts" />
// @filename: /tokenizer.ts
//// export default abstract class Tokenizer {
//// errorBuilder() {
//// return (pos: number, lineStart: number, curLine: number) => {};
//// }
//// }
// @filename: /expression.ts
//// import Tokenizer from "./tokenizer.js";
////
//// export default abstract class ExpressionParser extends Tokenizer {
//// /**/
//// }
verify.completions({
marker: "",
includes: [
{
name: "errorBuilder",
insertText: "errorBuilder(): (pos: number, lineStart: number, curLine: number) => void {\n}",
filterText: "errorBuilder",
},
],
preferences: {
includeCompletionsWithInsertText: true,
includeCompletionsWithClassMemberSnippets: true,
},
isNewIdentifierLocation: true,
});