LGTM
http://codereview.chromium.org/6248013/diff/1/src/scanner-base.cc File src/scanner-base.cc (right): http://codereview.chromium.org/6248013/diff/1/src/scanner-base.cc#newcode742 src/scanner-base.cc:742: if (c0_ == '\\') { // Escape sequence. Even so, we currently don't catch the syntax error until the RegExp literal is evaluated. If we change this to an early syntax error, we again risk the chance of breaking existing pages (it is an incompatible change from ES3 to ES5 to *require* early errors here). As a side note, our preparser means that we completely skip parsing of some functions until they are first called. That means that to catch errors early, the preparser must catch all early errors, since it's the only code to see the source in time. Since it doesn't build an AST or record most of its tokens, there are a number of early errors it can't catch in its current form. In either case, keeping RegExp validation in a separate patch is the right thing to do. http://codereview.chromium.org/6248013/diff/6001/src/scanner-base.cc#newcode68 src/scanner-base.cc:68: Make -1 a constant in the Scanner class. Scanner::kNoOctalLocation would be a fine name. And give it a comment that says that -1 is outside the range of real source code. http://codereview.chromium.org/6248013/ -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
