microsoft / microsoft/TypeScript
Method defined with defineProperty is not callable
オープン
まだ誰も着手していません。
Bug
Domain: JavaScript
- 主要言語
- Go
- スター
- 111k
- フォーク
- 14.3k
- 平均マージ
- 1日 19時間
- マージ済み PR(30日)
- 117
説明
Bug Report
🔎 Search Terms
defineProperty callable
🕗 Version & Regression Information
- This is the behavior in every version I tried
⏯ Playground Link
Playground link with relevant code
💻 Code
// This is JavaScript, not TypeScript
function A() {} // define A with class syntax leads to the same results
Object.defineProperty(A.prototype, "m", { value: function m() {}, writable: true, configurable: true });
const a = new A();
a.m()
🙁 Actual behavior
TypeScript identifies m as a method, but says it has no call signatures: Type '{}' has no call signatures.
🙂 Expected behavior
TypeScript allows a.m().
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
リンクされた TypeScript Playground で、JavaScript の例を使って動作を再現し、その後、型チェック中に Object.defineProperty がどのように処理されるかを追跡します。TypeScript が定義されたプロパティを呼び出し可能なものとして認識し、a.m() の型チェックが正常に通れば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, typescript
- 領域
- compilers
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100