Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(398)

Issue 6386014: Fix V8 bug 1084 (Closed)

Created:
9 years, 10 months ago by Martin Maly
Modified:
9 years, 7 months ago
Reviewers:
Lasse Reichstein
CC:
v8-dev
Visibility:
Public.

Description

Fix V8 bug 1084 Allow "\0" in strict mode as valid escape sequence. http://code.google.com/p/v8/issues/detail?id=1084 BUG=http://code.google.com/p/v8/issues/detail?id=1084 TEST=test/mjsunit/strict_mode.js

Patch Set 1 #

Total comments: 6

Patch Set 2 : CR Feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+107 lines, -93 lines) Patch
M src/scanner-base.h View 1 1 chunk +2 lines, -0 lines 0 comments Download
M src/scanner-base.cc View 1 2 chunks +8 lines, -2 lines 0 comments Download
M test/mjsunit/strict-mode.js View 1 5 chunks +97 lines, -91 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Martin Maly
9 years, 10 months ago (2011-01-30 02:08:29 UTC) #1
Lasse Reichstein
LGTM. http://codereview.chromium.org/6386014/diff/1/src/scanner-base.cc File src/scanner-base.cc (right): http://codereview.chromium.org/6386014/diff/1/src/scanner-base.cc#newcode100 src/scanner-base.cc:100: // ECMA-262. Other JS VMs support them. Add ...
9 years, 10 months ago (2011-01-31 06:05:19 UTC) #2
Martin Maly
9 years, 10 months ago (2011-01-31 22:44:05 UTC) #3
Done.

http://codereview.chromium.org/6386014/diff/1/src/scanner-base.cc
File src/scanner-base.cc (right):

http://codereview.chromium.org/6386014/diff/1/src/scanner-base.cc#newcode100
src/scanner-base.cc:100: // ECMA-262. Other JS VMs support them.
On 2011/01/31 06:05:19, Lasse Reichstein wrote:
> Add comment here (or, preferably, at the declaration) saying that it also
> accepts the decimal escape "\0".

Done.

http://codereview.chromium.org/6386014/diff/1/src/scanner-base.cc#newcode112
src/scanner-base.cc:112: // Allow \0 only. Rest are octal escapes, illegal in
strict mode.
On 2011/01/31 06:05:19, Lasse Reichstein wrote:
> We "allow" everything (we don't reject anything here), it's just '\0' that
isn't
> really an octal escape.
> Make comment something like "Anything except '\0' is an ocatal escape, which
are
> illegal in strict mode. Remember position to be able to give a better error
> message.".

Done.

http://codereview.chromium.org/6386014/diff/1/test/mjsunit/strict-mode.js
File test/mjsunit/strict-mode.js (right):

http://codereview.chromium.org/6386014/diff/1/test/mjsunit/strict-mode.js#new...
test/mjsunit/strict-mode.js:158: 
On 2011/01/31 06:05:19, Lasse Reichstein wrote:
> If the preparser marks this function as lazy (which it will), the body won't
be
> parsed by the parser at all. In that case, even if there was a strict-mode
> syntax error, I'm not sure it would be thrown.
> You need to call the function to be sure that it's parsed.
> 
> (We should probably add checks to the preparser too, to ensure that we make it
> an early error).

Done. The pereparser work is on my todo list.

Powered by Google App Engine
This is Rietveld 408576698