Comment #10 on issue 1818 by kpreid.switchb.org: ++, --, += ignore frozenness under v8
http://code.google.com/p/google-caja/issues/detail?id=1818

Confirmed above — but now I find that I cannot reproduce it in _strict_ mode.

(function() {
  function f(o) { o.x++ }
  return (function() {
    var o = {x: 5}
    Object.freeze(o);
    o.x === 5;
    for (var i = 0; i < 10000; i++) {try { f(o); } catch (e) {} }
    return o.x;
  })();
})();

The above yields 9743, but if I add a strict declaration to the outer function, it yields 5.

If this genuinely is non-strict only, then there is no problem for Caja.

(Re the complexities of the above — the try-catch is needed to deal with expected strict assignment failures. The inner function seems to be needed, possibly to keep the optimized function's context simple enough for optimization?

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--

--- You received this message because you are subscribed to the Google Groups "Google Caja Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to