On 2013/06/12 16:29:11, felix8a wrote:
er, that isn't a syntax error. it's legal and does the right thing.

True! :) 'Cuz it's in an identifier. So that leaves more questions ...

1. We'd need to do the right thing with atLeastFreeVarNames given an
identifier that has a Unicode escape sequence. We would need to put into
the scope object of our defensive "with () { ... }", not a property name
with a backslash-u, but a property name with an actual Unicode value in
it.

2. We'd need to know that a browser's interpreter, which by the comments
in the original code cannot be trusted to do the right thing with "var
te[u]st", will do the right thing with "var te\uFEFFst".

3. We'd need to figure out what happens when Unicode characters are not
within an identifier. In other words, if we get:

  var test [U] = 1;

and we rewrite it to:

  var test \uFEFF = 1;

then what happens? This is *not* legal and should fail. At the very
least, we'd need to know that it fails safe (in other words, in whatever
way is necessary so that atLeastFreeVarNames and the defensive "with() {
... }" is not defeated).


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