| 167 | Nan::Persistent<v8::FunctionTemplate> Edge::_template; |
| 168 | |
| 169 | NAN_METHOD(Edge::static_createLine) |
| 170 | { |
| 171 | v8::Local<v8::Value> arg1 = info[0]; |
| 172 | v8::Local<v8::Value> arg2 = info[1]; |
| 173 | if (arg1.IsEmpty() || arg2.IsEmpty()) { |
| 174 | return Nan::ThrowError("expecting 2 arguments : <vertex|point> , <vertex|point> "); |
| 175 | } |
| 176 | |
| 177 | Vertex* v1 = getOrCreateVertex(info[0]); |
| 178 | Vertex* v2 = getOrCreateVertex(info[1]); |
| 179 | if (!v1 || !v2) { |
| 180 | return Nan::ThrowError("expecting 2 arguments : <vertex|point> , <vertex|point> "); |
| 181 | } |
| 182 | |
| 183 | v8::Local<v8::Object> instance = Nan::NewInstance(Constructor<Edge>()).ToLocalChecked(); |
| 184 | Edge* pThis = Nan::ObjectWrap::Unwrap<Edge>(Nan::To<v8::Object>(instance).ToLocalChecked()); |
| 185 | |
| 186 | pThis->createLine(v1, v2); |
| 187 | info.GetReturnValue().Set(instance); |
| 188 | } |
| 189 | |
| 190 | NAN_METHOD(Edge::static_createCircle) |
| 191 | { |
nothing calls this directly
no test coverage detected