googlearchive / caja

Caja is a tool for safely embedding third party HTML, CSS and JavaScript in your website.
Apache License 2.0
1.13k stars 113 forks source link

compileExpr lacks Unicode whitespace gimmick #1824

Open kpreid opened 9 years ago

kpreid commented 9 years ago

Original issue 1826 created by kpreid.switchb.org on 2013-07-30T17:17:20.000Z:

r5468 forces rerendering in compileModule if there is funny whitespace, in order to obtain a source string which omits it. However, compileModule is not a bottleneck for eval; there is also compileExpr. Thus, cajaVM.compileExpr('1\u2000') fails whereas cajaVM.compileModule('1\u2000') correctly succeeds.

We should make sure that compileExpr and compileModule behave the same outside of the syntactic distinction they are intended to make. Perhaps some refactoring?

kpreid commented 9 years ago

Comment #1 originally posted by kpreid.switchb.org on 2013-07-30T17:17:36.000Z:

<empty>

kpreid commented 9 years ago

Comment #2 originally posted by erights on 2013-07-30T18:42:22.000Z:

Also make sure that ses/compileExprLater.js is kept in sync with these.

kpreid commented 9 years ago

Comment #3 originally posted by kpreid@google.com on 2013-11-07T20:30:10.000Z:

<empty>