MCPcopy Create free account
hub / github.com/NativeScript/android / ClearTimer

Method ClearTimer

test-app/runtime/src/main/cpp/Timers.cpp:208–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

206}
207
208void 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
224void Timers::SetTimer(const v8::FunctionCallbackInfo<v8::Value> &args, bool repeatable) {
225 auto argLength = args.Length();

Callers

nothing calls this directly

Calls 6

ToMaybePositiveValueFunction · 0.85
removeTaskMethod · 0.80
LengthMethod · 0.45
DataMethod · 0.45
ValueMethod · 0.45
GetIsolateMethod · 0.45

Tested by

no test coverage detected