// The shortestPaths function exists solely to let the fuzzers go to town and // exercise the code paths it calls into, hence the only things to assert // relate to the shortestPaths test function API. // // The actual behavior of JS::ubi::ShortestPaths is tested in // js/src/jsapi-tests/testUbiNode.cpp, where we can actually control the // structure of the heap graph to test specific shapes.
function f(x) { return x + x;
}
var g = f.bind(null, 5);
var o = {
p: g
};
function describe(v) { return v === undefined ? "(undefined)"
: v === null ? "(null)"
: typeof(v) === "object" ? Object.prototype.toString.call(v)
: typeof(v);
}
try { paths = shortestPaths([f], { maxNumPaths: -1 }); } catch (exc) { e = "" + exc; };
assertEq(e, "TypeError: -1 is not greater than 0");
// Bug 1799824.
let arr = [{}];
let objWithGetter = {get start() { arr.length = 0; return {}; }}; try { paths = shortestPaths(arr, objWithGetter); } catch (exc) { e = ""+exc; }
assertEq(e, "TypeError: arr is not a dense array object with one or more elements");
}
Messung V0.5
¤ Dauer der Verarbeitung: 0.16 Sekunden
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.