hongee / google-caja

Automatically exported from code.google.com/p/google-caja
0 stars 0 forks source link

JsLexer.isRegexp problem #249

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
<script>
a = min / max;
</script>

FATAL_ERROR: a1.html:2+9 - 3+1: Unclosed string

1, the error message is a little confusing, it's an unclosed regexp, not an
unclosed string.

2, the js lexer thinks the / is a regexp, because JsLexer.isRegexp is
checking if the previous token is a keyword using find() instead of
matches().  so 'min' matches the pattern, because 'in' is a keyword.

Original issue reported on code.google.com by grayscale@gmail.com on 7 May 2008 at 11:53

GoogleCodeExporter commented 9 years ago
heh, wrong cookie.  that was me.

Original comment by felix8a on 7 May 2008 at 11:56

GoogleCodeExporter commented 9 years ago

Original comment by mikesamuel@gmail.com on 7 May 2008 at 11:10

GoogleCodeExporter commented 9 years ago

Original comment by mikesamuel@gmail.com on 10 May 2008 at 12:44

GoogleCodeExporter commented 9 years ago

Original comment by mikesamuel@gmail.com on 10 May 2008 at 1:21