1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
function f(o) { var res = 0; for (var i=0; i<11000; i++) { res += o.x; } return res; } function O(x) { if (x) this.x = 10; } f(new O(true)); // "o.x" is now missing so the idempotent cache should invalidate f. f(new O(false));