| 206 | } |
| 207 | |
| 208 | void Timers::ClearTimer(const v8::FunctionCallbackInfo<v8::Value> &args) { |
| 209 | auto argLength = args.Length(); |
| 210 | auto extData = args.Data().As<External>(); |
| 211 | auto thiz = reinterpret_cast<Timers *>(extData->Value()); |
| 212 | int id = -1; |
| 213 | if (argLength > 0) { |
| 214 | auto isolate = args.GetIsolate(); |
| 215 | auto ctx = isolate->GetCurrentContext(); |
| 216 | id = (int) ToMaybePositiveValue(args[0], ctx); |
| 217 | } |
| 218 | // ids start at 1 |
| 219 | if (id > 0) { |
| 220 | thiz->removeTask(id); |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | void Timers::SetTimer(const v8::FunctionCallbackInfo<v8::Value> &args, bool repeatable) { |
| 225 | auto argLength = args.Length(); |
nothing calls this directly
no test coverage detected