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

Issue 7193045: Make preparser detect duplicate parameters and object literal properties. (Closed)

Created:
9 years, 5 months ago by Lasse Reichstein
Modified:
9 years, 5 months ago
Reviewers:
Rico
CC:
v8-dev
Visibility:
Public.

Description

Make preparser detect duplicate parameters and object literal properties. This is a fix and reapply of r8516 with some comments addressed and more tests added. The difference from r8516 is that canonicalization of number literals is no performed using the same methods as in v8, to avoid false positives/negatives when detecting duplicates. Committed: http://code.google.com/p/v8/source/detail?r=8541

Patch Set 1 #

Patch Set 2 : Added more duplicate parameter tests. #

Total comments: 5

Patch Set 3 : Addressed review comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+611 lines, -76 lines) Patch
M src/SConscript View 1 chunk +5 lines, -0 lines 0 comments Download
M src/bignum-dtoa.cc View 2 chunks +5 lines, -2 lines 0 comments Download
M src/conversions.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/conversions.cc View 3 chunks +2 lines, -21 lines 0 comments Download
M src/dtoa.cc View 2 chunks +5 lines, -2 lines 0 comments Download
M src/fast-dtoa.cc View 2 chunks +4 lines, -2 lines 0 comments Download
M src/fixed-dtoa.cc View 2 chunks +4 lines, -2 lines 0 comments Download
M src/preparser.h View 4 chunks +97 lines, -0 lines 0 comments Download
M src/preparser.cc View 1 2 20 chunks +215 lines, -33 lines 0 comments Download
M src/preparser-api.cc View 1 chunk +1 line, -0 lines 0 comments Download
M src/scanner-base.h View 1 chunk +2 lines, -0 lines 0 comments Download
M src/utils.h View 2 chunks +15 lines, -10 lines 0 comments Download
A test/preparser/duplicate-parameter.pyt View 1 2 1 chunk +90 lines, -0 lines 0 comments Download
A test/preparser/duplicate-property.pyt View 1 2 1 chunk +162 lines, -0 lines 0 comments Download
M test/preparser/testcfg.py View 3 chunks +2 lines, -4 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Lasse Reichstein
9 years, 5 months ago (2011-07-06 07:13:59 UTC) #1
Rico
LGTM, please fix python indention to two characters + nit http://codereview.chromium.org/7193045/diff/1016/src/preparser.cc File src/preparser.cc (right): http://codereview.chromium.org/7193045/diff/1016/src/preparser.cc#newcode1538 ...
9 years, 5 months ago (2011-07-06 07:55:11 UTC) #2
Lasse Reichstein
9 years, 5 months ago (2011-07-06 08:20:00 UTC) #3
http://codereview.chromium.org/7193045/diff/1016/src/preparser.cc
File src/preparser.cc (right):

http://codereview.chromium.org/7193045/diff/1016/src/preparser.cc#newcode1538
src/preparser.cc:1538: // Quick check for already being in canonical form.
I'll assert the string isn't empty.
IsNumberCanonical doesn't accept an empty string, nor an invalid number literal,
but StringToDouble might accepts the empty string.
As for testing that it's a number, the number-parsing should do that fine.

http://codereview.chromium.org/7193045/diff/1016/test/preparser/duplicate-par...
File test/preparser/duplicate-parameter.pyt (right):

http://codereview.chromium.org/7193045/diff/1016/test/preparser/duplicate-par...
test/preparser/duplicate-parameter.pyt:54: """, "id": "selfstrictnestedclean"}
Those lines are part of a multiline string literal.

Powered by Google App Engine
This is Rietveld 408576698