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#newcode101
src/scanner-base.cc:101: octal_loc_.beg_pos = source_pos() - 1;    //
Already advanced
It seems like overkill to store both beg and end pos for an octal
literal.
Just store the beginning (and initialize it to -1 until the first one is
found, that will be outside the range of all source code).

http://codereview.chromium.org/6248013/diff/1/src/scanner-base.cc#newcode602
src/scanner-base.cc:602: // TODO(mmaly): Do we want to keep the
auto-upgrade to decimal?
Alas, yes.
Unless it turns out that Safari has changed on that too.
It's only octal escapes that are disallowed as grammar extensions, not
decimal escapes.

http://codereview.chromium.org/6248013/diff/1/src/scanner-base.cc#newcode742
src/scanner-base.cc:742: if (c0_ == '\\') {  // Escape sequence.
We should also add checking of RegExp literals. They may also contain
octal escapes. It is not as simple as checking whether the next
character after '\' is '0'. The sequence '\12' may be the octal escape
for newline, or it may be a backreference to capture 12, or a
backreference to capture 1 followed by a "2". We really need to do a
full parse of the regexp to know.
I don't remember off-hand whether we parse the regexp eagerly for syntax
errors, or if we delay it until it's first executed. If the latter, then
we probably need to do it earlier for strict code.

http://codereview.chromium.org/6248013/

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to