nodejs / nodejs/node-addon-api
Migration from NAN to object_wrap / determine invoked property name
未關閉
還沒有人認領這個 Issue。
never-stale
- 主要語言
- C++
- 星號
- 2.4k
- 分支
- 499
- 平均合併
- 2 天 11 小時
- 30 天內合併 PR
- 2
描述
This is a usage / migration from NAN question. With NAN I used the following to determine the invoked property name:
NAN_GETTER(ClassName::Getters)
{
...
std::string propertyName = *Nan::Utf8String(property);
...
}
This helped me to reduce C++ boilerplate code for classes with many properties because I did not have to declare and define every single setter and getter method in C++.
Is this still possible?
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
該 issue 提到了 NAN getters 和 object_wrap,但沒有指明檔案或測試。首先查看 node-addon-api 的移轉指南和 object_wrap accessor API,然後將它們與所示的 NAN 模式進行比較。完成的標準是記錄是否可以取得被呼叫的屬性名稱,並提供受支援的移轉路徑,或說明該限制。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- cpp, nodejs
- 領域
- api, developer-experience
- Issue 類型
- 文件
- 難度
- 5/5
- 預估耗時
- 一週以上
- 活躍度
- 停滯
- 描述清晰度
- 需要釐清
- 新手友好度
- 25/100