Call Local<Function> with ObjectWrap as argument

Offen
#50 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
25/100
Issue-Typ
Dokumentation
Klarheit
Muss geklärt werden
Aktivitätsstatus
Veraltet
Tech-Stack
cpp, node.js
Bereich
documentation

Rechercherichtung

Start with the Node.js addon examples and the ObjectWrap, Local, and Local API documentation named in the issue. Done means documenting a supported way to create an ObjectWrap-backed value and pass it to the persistent JavaScript callback without constructor round-tripping.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

I cannot find any information on how to create an ObjectWrap and pass it as an argument to a Local. I have a persistent callback registered and need to call it with a new instance of an ObjectWrap. I could do this by calling the (JS) constructor and pass it (JS) arguments which returns a new instance, but I want to avoid this round tripping.

Basically: how to create an ObjectWrap and get a Local out of it so that I can pass it as an argument to a JS function?

Vorherrschende Sprache
C++
Sterne
2.6k
Forks
598
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus nodejs/node-addon-examples

Alle Issues in nodejs/node-addon-examples

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.