// Use --expose_gc for V8 (and Node.js) // to pass this flag at chrome launch use: --js-flags="--expose-gc" // Exposed in SpiderMonkey shell as well if (self.gc) { return self.gc();
}
// Present in some WebKit development environments if (self.GCController) { return GCController.collect();
}
console.warn( 'Tests are running without the ability to do manual garbage collection. ' + 'They will still work, but coverage will be suboptimal.');
for (var i = 0; i < 1000; i++) {
gcRec(10);
}
function gcRec(n) { if (n < 1) { return {};
}
let temp = { i: "ab" + i + i / 100000 };
temp += "foo";
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.