MCPcopy Create free account
hub / github.com/Distributive-Network/PythonMonkey / timerHasRef

Function timerHasRef

src/internalBinding/timers.cc:72–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70}
71
72static bool timerHasRef(JSContext *cx, unsigned argc, JS::Value *vp) {
73 JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
74 double timeoutID = args.get(0).toNumber();
75
76 // Retrieve the AsyncHandle by `timeoutID`
77 AsyncHandle *handle = AsyncHandle::fromId((uint32_t)timeoutID);
78 if (!handle) return false; // error no such timeoutID
79
80 args.rval().setBoolean(handle->hasRef());
81 return true;
82}
83
84static bool timerAddRef(JSContext *cx, unsigned argc, JS::Value *vp) {
85 JS::CallArgs args = JS::CallArgsFromVp(argc, vp);

Callers 1

hasRefMethod · 0.85

Calls 2

getMethod · 0.80
hasRefMethod · 0.45

Tested by

no test coverage detected