Ah I understand now. Right. Given input where [U] stands for an embedded
Unicode character:

  var te[U]st = 1;
  var x = 'te[U]st';

The resulting, indiscriminately escaped code will look something like:

  var te\uFEFFst = 1;
  var x = 'te\uFEFFst';

We would then throw a syntax error on the first line.

1. It would be a somewhat whacky error, and hard to trace back to the
original issue.

2. We would have to reproduce the Unicode escaping logic somewhere in
our code, whereas the parse tree renderer already has it for us.

3. We would have to worry about whether this constitutes "rewriting" and
warrants adding our boilerplate comment or not.

So to clarify: This CL is really a hack to support a particular jQuery
file. The file was originally written with escaped Unicode in string
literals. However, it was subsequently minified, and the minifier turned
these into literal UTF-8 sequences. We would like to support this file
(and others like it) as-is so we can do automated testing of jQuery
versions without having to change the jQuery code....

I dunno -- it seems to me that, if SES operates without a parser, it's
not unreasonable to say, please give us "clean" code kthxbai! ...

https://codereview.appspot.com/10205043/

--

--- 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