microsoft / microsoft/TypeScript

should be able to run typescript under `--frozen-intrinsics`

オープン
#53,699 コメント 2 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Experience Enhancement Suggestion
主要言語
Go
スター
111k
フォーク
14.4k
平均マージ
1日 19時間
マージ済み PR(30日)
117

説明

Bug Report

🔎 Search Terms
  • --frozen-intrinsics
  • Error.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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

示されている reproduce.mjs の例を使って node --frozen-intrinsics で失敗を再現し、その後 src/compiler/sys.ts の fileSystemEntryExists 周辺と、typescrip​​t.js の対応する箇所を調べます。--frozen-intrinsics で TypeScript のインポートと ts.sys.fileExists の呼び出しが成功し、示されているように true を返せば作業は完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
node.js, typescript
領域
compilers
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。