Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reportNonexistentProperty crash when requesting references #60336

Open
Andarist opened this issue Oct 24, 2024 · 0 comments
Open

reportNonexistentProperty crash when requesting references #60336

Andarist opened this issue Oct 24, 2024 · 0 comments
Labels
Bug A bug in TypeScript Help Wanted You can do this
Milestone

Comments

@Andarist
Copy link
Contributor

πŸ”Ž 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Help Wanted You can do this
Projects
None yet
Development

No branches or pull requests

2 participants