dpjayasekara
5/11/2018 - 1:08 PM

Where timer_wrap's Start function is set to 'start' which can be accessed from JS

Where timer_wrap's Start function is set to 'start' which can be accessed from JS

class TimerWrap : public HandleWrap {
 public:
  static void Initialize(Local<Object> target,
                         Local<Value> unused,
                         Local<Context> context) {
    // ....redacted....
    
    env->SetProtoMethod(constructor, "hasRef", HandleWrap::HasRef);

    env->SetProtoMethod(constructor, "start", Start);
    env->SetProtoMethod(constructor, "stop", Stop);
    
    // ....redacted....