| 134 | } |
| 135 | |
| 136 | void Wire::Init(v8::Local<v8::Object> target) |
| 137 | { |
| 138 | // Prepare constructor template |
| 139 | v8::Local<v8::FunctionTemplate> tpl = Nan::New<v8::FunctionTemplate>(Wire::New); |
| 140 | tpl->SetClassName(Nan::New("Wire").ToLocalChecked()); |
| 141 | |
| 142 | // object has one internal filed ( the C++ object) |
| 143 | tpl->InstanceTemplate()->SetInternalFieldCount(1); |
| 144 | |
| 145 | _template.Reset(tpl); |
| 146 | |
| 147 | // Prototype |
| 148 | v8::Local<v8::ObjectTemplate> proto = tpl->PrototypeTemplate(); |
| 149 | |
| 150 | Base::InitProto(proto); |
| 151 | |
| 152 | EXPOSE_METHOD(Wire,getEdges); |
| 153 | EXPOSE_METHOD(Wire,getVertices); |
| 154 | EXPOSE_READ_ONLY_PROPERTY_INTEGER(Wire, numVertices); |
| 155 | EXPOSE_READ_ONLY_PROPERTY_INTEGER(Wire, numEdges); |
| 156 | EXPOSE_READ_ONLY_PROPERTY_BOOLEAN(Wire, isClosed); |
| 157 | |
| 158 | Nan::Set(target,Nan::New("Wire").ToLocalChecked(), Nan::GetFunction(tpl).ToLocalChecked()); |
| 159 | } |
| 160 | |
| 161 | NAN_METHOD(Wire::getEdges) |
| 162 | { |
no outgoing calls
no test coverage detected