Multiple classes (wrapped objects)
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 30/100
調査の方向性
Start by comparing the Init() methods for both classes, focusing on the shared env.SetInstanceData and exports.Set calls shown in the issue. Check the Node-API addon examples and any relevant tests or entry points for how multiple constructors are registered; done means both classes can be exported and instantiated without one constructor replacing the other.
索引モデルが issue の本文から書いたものです。
説明
My problem is multiple classes (objects) exported via my Init() functions.
I have two classes that I want to use in my javascript but the 'constructor' seems to be overwritten with whoever gets Init()'d i.e.:
// This code is present in both classes Init() method:
Napi::FunctionReference* constructor = new Napi::FunctionReference();
*constructor = Napi::Persistent(func);
env.SetInstanceData(constructor);
exports.Set("Dataset", func);
Question: Is it possible to export have more than one class object??
- 主要言語
- C++
- スター
- 2.6k
- フォーク
- 598
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
nodejs/node-addon-examples のほかの issue
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 38/100
nodejs/node-addon-examples#585 · リアクション 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
nodejs/node-addon-examples#530 · コメント 1 件 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
nodejs/node-addon-examples#445 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 32/100
nodejs/node-addon-examples#444 · コメント 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
nodejs/node-addon-examples#381 ·
nodejs/node-addon-examples の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
meshcore-dev/MeshCore#3760 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
deepseek-ai/DeepGEMM-Ascend#29 ·
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
EchoTools/nevr-runtime#2042 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
emscripten-core/emscripten#28160 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Download size and speed show scientific notation between 1000 and 1023 units対応中かも @RaphaelFakhri が今日担当しました。 オープン
難易度 2/5 1時間未満 初心者へのやさしさ 88/100
kiwix/kiwix-desktop#1570 ·
メンテナーはふだん 1 日以内に返信