microsoft / microsoft/TypeScript
should be able to run typescript under `--frozen-intrinsics`
Offen
Dieses Issue hat noch niemand übernommen.
Experience Enhancement
Suggestion
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.4k
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 117
Beschreibung
Bug Report
🔎 Search Terms
--frozen-intrinsicsError.stackTraceLimit- prototype protection
🕗 Version & Regression Information
- This is a crash
- This changed between versions ______ and _______
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
- I was unable to test this on prior versions because _______
⏯ Playground Link
Playground link with relevant code
💻 Code
import ts from 'typescript'
console.log(ts.sys.fileExists("reproduce.mjs"))
🙁 Actual behavior
$ node --frozen-intrinsics reproduce.mjs
(node:239937) ExperimentalWarning: The --frozen-intrinsics flag is experimental
(Use `node --trace-warnings ...` to show where the warning was created)
/path/to/node_modules/typescript/lib/typescript.js:6530
Error.stackTraceLimit = 0;
^
TypeError <Object <Object <[Object: null prototype] {}>>>: Cannot assign to read only property 'stackTraceLimit' of function 'function Error() { [native code] }'
at fileSystemEntryExists (/path/to/node_modules/typescript/lib/typescript.js:6530:35)
at fileExists (/path/to/node_modules/typescript/lib/typescript.js:6551:20)
at isFileSystemCaseSensitive (/path/to/node_modules/typescript/lib/typescript.js:6397:21)
at getNodeSystem (/path/to/node_modules/typescript/lib/typescript.js:6189:45)
at /path/to/node_modules/typescript/lib/typescript.js:6603:18
at src/compiler/sys.ts (/path/to/node_modules/typescript/lib/typescript.js:6609:9)
at __init (/path/to/node_modules/typescript/lib/typescript.js:22:58)
at src/compiler/_namespaces/ts.ts (/path/to/node_modules/typescript/lib/typescript.js:125073:7)
at __init (/path/to/node_modules/typescript/lib/typescript.js:22:58)
at src/typescript/_namespaces/ts.ts (/path/to/node_modules/typescript/lib/typescript.js:169775:7)
Node.js v18.15.0
🙂 Expected behavior
$ node reproduce.mjs
true
$ node --frozen-intrinsics reproduce.mjs
true
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduzieren Sie den Fehler mit node --frozen-intrinsics unter Verwendung des gezeigten reproduce.mjs-Beispiels und untersuchen Sie anschließend src/compiler/sys.ts im Bereich von fileSystemEntryExists sowie die entsprechende Stelle in typescript.js. Die Arbeit ist abgeschlossen, wenn das Importieren von TypeScript und der Aufruf von ts.sys.fileExists unter --frozen-intrinsics erfolgreich sind und wie gezeigt true zurückgeben.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- node.js, typescript
- Bereich
- compilers
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 45/100