سؤال

I have the following code in javascript:

var c = new addon.Component();
c.ComponentLength = 3

How should i build my addon, so i can do the previous code? I've already followed the tutorials in http://nodejs.org/api/addons.html , but i'm stuck here.

Is this possible? Does anyone have a solution?

Thanks in advance.

هل كانت مفيدة؟

المحلول

The solution is on the v8.h, search for SetAccessor , which "Sets an accessor on the object template.".

An example: http://syskall.com/how-to-write-your-own-native-nodejs-extension/

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top