MCPcopy Index your code
hub / github.com/nodejs/node / toggle

Function toggle

deps/v8/tools/clusterfuzz/js_fuzzer/random.js:36–39  ·  view source on GitHub ↗

* Toggle a boolean flag with a probability.

(flag, prob)

Source from the content-addressed store, hash-verified

34 * Toggle a boolean flag with a probability.
35 */
36function toggle(flag, prob) {
37 assert(typeof flag == 'boolean');
38 return Boolean(choose(prob) ^ flag);
39}
40
41/**
42 * Returns "count" elements, randomly selected from "highProbArray" and

Callers

nothing calls this directly

Calls 2

chooseFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…