nodejs / nodejs/node-addon-api
Enforce callback signatures with C++ Concepts
まだ誰も着手していません。
- 主要言語
- C++
- スター
- 2.4k
- フォーク
- 499
- 平均マージ
- 2日 11時間
- マージ済み PR(30日)
- 2
説明
#1738 documented the required signature of the templated finalizer callback parameters as inline comment hints.
These are human-only annotations. The compiler does not enforce them, so a mismatched callable fails deep inside the template instantiation with an unhelpful error.
Once C++20 is the minimum supported standard, we should replace these hints with C++ Concepts that constrain the Finalizer/FinalizerType template parameters. This gives compiler-enforced contracts and clear diagnostics at the call site.
Finalizer candidates:
BasicEnv::PostFinalizerObject::AddFinalizerExternal::NewBuffer::New/Buffer::NewOrCopyThreadSafeFunction::NewTypedThreadSafeFunction::New
Callback candidates:
Function::New— the JS callback (Callable)PropertyDescriptor::Accessor—Getter/SetterPropertyDescriptor::Function—CallableThreadSafeFunction::BlockingCall/NonBlockingCall—CallbackTypedThreadSafeFunction::BlockingCall/NonBlockingCall—CallbackTypedThreadSafeFunction— theCallJscallback
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
#1738 のインラインシグネチャアノテーションと、列挙されているテンプレートのエントリポイント(BasicEnv::PostFinalizer、Object::AddFinalizer、External::New、Buffer::New、ThreadSafeFunction APIs を含む)を確認する。各 Finalizer、Callable、Getter、Setter、Callback の候補に必要な制約を特定する。C++20 Concepts によってドキュメント化されたシグネチャが強制され、呼び出し箇所で診断が生成されれば完了とする。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- cpp
- 領域
- api
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 52/100