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

Function normalizeSliceTerm

src/PyListProxyHandler.cc:180–191  ·  view source on GitHub ↗

private util

Source from the content-addressed store, hash-verified

178
179// private util
180static inline uint64_t normalizeSliceTerm(int64_t value, uint64_t length) {
181 if (value < 0) {
182 value += length;
183 if (value < 0) {
184 return 0;
185 }
186 }
187 else if (double(value) > double(length)) {
188 return length;
189 }
190 return value;
191}
192
193static bool array_slice(JSContext *cx, unsigned argc, JS::Value *vp) {
194 JS::CallArgs args = JS::CallArgsFromVp(argc, vp);

Callers 1

array_sliceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected