Skip to content

reportNonexistentProperty crash when requesting referencesΒ #60336

@Andarist

Description

@Andarist

πŸ”Ž Search Terms

reportNonexistentProperty references js string literal

πŸ•— Version & Regression Information

  • This is the behavior in every version I tried

⏯ Playground Link

N/A

πŸ’» Code

/// <reference path="fourslash.ts" />

// @strict: true
// @allowJs: true
// @checkJs: true

// @filename: ./src/parser-input.js
//// export default () => {
////   let input;
////
////   const parserInput = {};
////
////   parserInput.currentChar = () => input.charAt(parserInput.i);
////
////   parserInput.end = () => {
////     const isFinished = parserInput.i >= input.length;
////
////     return {
////       isFinished,
////       furthest: parserInput.i,
////     };
////   };
////
////   return parserInput;
//// };

// @filename: ./src/parser.js
//// import getParserInput from "./parser-input";
////
//// const Parser = function Parser(context, imports, fileInfo, currentIndex) {
////   currentIndex = currentIndex || 0;
////   let parsers;
////   const parserInput = getParserInput();
////
////   return {
////     parserInput,
////     parsers: (parsers = {
////       variable: function () {
////         let name;
////
////         if (parserInput.currentChar() === "/*1*/@") {
////           return name[1];
////         }
////       },
////     }),
////   };
//// };
////
//// export default Parser;

verify.baselineFindAllReferences("1");

πŸ™ Actual behavior

it crashes like here: #60293 (comment)

πŸ™‚ Expected behavior

it shouldnt crash

Additional information about the issue

related to #55889 , this issue here can be fixed by wrapping reportNonexistentProperty with addLazyDiagnostic but the other can't since non-LSP scenarios always go through checkSourceFileWithEagerDiagnostics

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions