IDisposable: typings say `dispose()`, dynamic binding exposes `Dispose()`
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 82/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- csharp, javascript, typescript
調査の方向性
Start with the cited generator code in src/NodeApi.Generator/TypeDefinitionsGenerator.cs around lines 1217-1221 and the dynamic exporter in src/NodeApi.DotNetHost/TypeExporter.cs around lines 790-797. Reproduce the issue with the provided net472 dynamic-binding example, then verify that generated typings and runtime method names agree for IDisposable; done means calling the typed method no longer fails.
索引モデルが issue の本文から書いたものです。
説明
With dynamic binding (require("node-api-dotnet/net472") then dotnet.load("MyLib.dll")), a class that implements IDisposable gets dispose(): void in the generated .d.ts, but the object at runtime has Dispose and no dispose. Calling the typed name throws TypeError: x.dispose is not a function. TypeScript accepts the call, and a test mock written from the .d.ts passes, so the mismatch only surfaces in production.
Reproduced with node-api-dotnet 0.9.27 and a net472 host:
const t = dotnet.MyLib.Thing.Create();
Object.getOwnPropertyNames(Object.getPrototypeOf(t));
// [..., "Dispose", "Equals", "GetHashCode", "GetType", "ToString", ...]
typeof t.dispose; // "undefined"
The generator renames the method to match the JS convention: https://github.com/microsoft/node-api-dotnet/blob/958b8c3c04dff5414781a88f069062c6528f7427/src/NodeApi.Generator/TypeDefinitionsGenerator.cs#L1217-L1221
The dynamic exporter registers methods under the .NET name with no equivalent rename: https://github.com/microsoft/node-api-dotnet/blob/958b8c3c04dff5414781a88f069062c6528f7427/src/NodeApi.DotNetHost/TypeExporter.cs#L790-L797
Either name is fine, but the two paths should agree.
- 主要言語
- C#
- スター
- 783
- フォーク
- 80
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
microsoft/node-api-dotnet のほかの issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
microsoft/node-api-dotnet#484 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
microsoft/node-api-dotnet#481 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
microsoft/node-api-dotnet#486 · コメント 1 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
microsoft/node-api-dotnet#483 · コメント 1 件 · リアクション 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
microsoft/node-api-dotnet#479 ·
microsoft/node-api-dotnet の issue をすべて見る
似ている issue
-
Money ExploitsオープンS: Untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
project-wayfarer/wayfarer-14#1628 ·
メンテナーはふだん 3 日以内に返信
-
:watch: Not Triaged dotnet-target-version
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
copilot documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
メンテナーはふだん 2 日以内に返信
-
untriaged
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
dotnet/dotnet-api-docs#13124 ·
メンテナーはふだん 1 日以内に返信
-
agentic-workflows
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信