MCPcopy Create free account
hub / github.com/nodejs/node / toRangeWrapper

Function toRangeWrapper

deps/v8/test/mjsunit/harmony/atomics.js:7–20  ·  view source on GitHub ↗
(is_big)

Source from the content-addressed store, hash-verified

5// Flags: --js-staging
6
7function toRangeWrapper(is_big) {
8 return function _toRangeWrapped(raw_value) {
9 var raw_range = this.max - this.min + (is_big ? 1n : 1);
10 let range = is_big ? BigInt(raw_range) : raw_range;
11 let value = is_big ? BigInt(raw_value) : raw_value;
12 while (value < this.min) {
13 value += range;
14 }
15 while (value > this.max) {
16 value -= range;
17 }
18 return value;
19 }
20}
21
22function makeConstructorObject(constr, min, max, toRange) {
23 var o = {constr: constr, min: min, max: max};

Callers 1

makeConstructorObjectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected