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

Function timerAddRef

src/internalBinding/timers.cc:84–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84static bool timerAddRef(JSContext *cx, unsigned argc, JS::Value *vp) {
85 JS::CallArgs args = JS::CallArgsFromVp(argc, vp);
86 double timeoutID = args.get(0).toNumber();
87
88 // Retrieve the AsyncHandle by `timeoutID`
89 AsyncHandle *handle = AsyncHandle::fromId((uint32_t)timeoutID);
90 if (!handle) return false; // error no such timeoutID
91
92 handle->addRef();
93
94 args.rval().setUndefined();
95 return true;
96}
97
98static bool timerRemoveRef(JSContext *cx, unsigned argc, JS::Value *vp) {
99 JS::CallArgs args = JS::CallArgsFromVp(argc, vp);

Callers 1

refMethod · 0.85

Calls 2

getMethod · 0.80
addRefMethod · 0.80

Tested by

no test coverage detected