Weak Map stress test

David Bruant david.bruant at labri.fr
Wed May 11 11:28:15 PDT 2011


Hi,

I've thought about this test:
-----
var wm = WeakMap();
var key = {}, value = {};

while(true){
  wm.set(key, value);
  key = value;
  value = {};
}
-----
At each loop turn, the reference of the "key" object is lost, so it's
garbage collectable. After a second turn, the "value" object of this
entry becomes garbage-collectable too.

There isn't that much of a conformance test here, but It'd be good to
expect ES engines to survive this test for as long as possible.
I cannot add this test to any official test suite, so if you think it
has value, just take it. I release it as public domain. Do whatever you
cant with it as long as it makes ES engines better in any way.

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110511/00d1196f/attachment.html>


More information about the es-discuss mailing list