Comment #5 on issue 1274 by felix8a: Current "virtualize" strategy isn't safe
http://code.google.com/p/google-caja/issues/detail?id=1274

innocent code written like
  Array.prototype.sort.call(x, comparator)
will work whether or not it's interacting with a Caja runtime,
but innocent code written like
  x.sort___(comparator)
will fail without a Caja runtime.

alternatives:

2: innocent code could be maintained in two forms.   way too annoying.
3: innocent code could be written as x.sort___() and automatically transformed into non-caja form. this is probably doable, but the transformation step is a burden on development. 4: innocent code could be written as x.sort___() and can be run in a non-caja environment by first loading a lightweight shim. not too annoying, but it's extra js code size.
5: combination of 3 in production and 4 in development.


Reply via email to