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

Issue 6335013: Strict mode eval/arguments LHS. (Closed)

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

Description

Strict mode eval/arguments LHS. BUG= TEST=

Patch Set 1 #

Total comments: 8

Patch Set 2 : CR Feedback #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -2 lines) Patch
M src/messages.js View 1 1 chunk +3 lines, -0 lines 0 comments Download
M src/parser.h View 1 1 chunk +5 lines, -0 lines 0 comments Download
M src/parser.cc View 1 4 chunks +35 lines, -0 lines 0 comments Download
M test/mjsunit/strict-mode.js View 1 2 chunks +62 lines, -2 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Martin Maly
Next installment of strict mode.
9 years, 11 months ago (2011-01-25 23:19:17 UTC) #1
Lasse Reichstein
LGTM. http://codereview.chromium.org/6335013/diff/1/src/messages.js File src/messages.js (right): http://codereview.chromium.org/6335013/diff/1/src/messages.js#newcode240 src/messages.js:240: strict_lhs_postfix: "Operand of postfix expression may not be ...
9 years, 10 months ago (2011-01-26 08:03:59 UTC) #2
Martin Maly
9 years, 10 months ago (2011-01-26 19:19:33 UTC) #3
incorporated all feedback, thanks for the review, Lasse!

Martin

http://codereview.chromium.org/6335013/diff/1/src/messages.js
File src/messages.js (right):

http://codereview.chromium.org/6335013/diff/1/src/messages.js#newcode240
src/messages.js:240: strict_lhs_postfix:           "Operand of postfix
expression may not be eval or arguments in strict mode",
On 2011/01/26 08:03:59, Lasse Reichstein wrote:
> Unless this is what Webkit uses as error message (we should generally match
> those), it should say that it's only increment/decrement postfix and prefix
> operators that must not be eval or arguments (i.e., when the operand must be
an
> LValue), and not, e.g., the "!" operator.

Webkit only says "parse error". Updated the errors to refer to incr/decr only. I
still have the bug open to eventually go through all the error messages and
reconcile them with jsc and mozilla.

http://codereview.chromium.org/6335013/diff/1/src/parser.h
File src/parser.h (right):

http://codereview.chromium.org/6335013/diff/1/src/parser.h#newcode617
src/parser.h:617: void CheckStrictModeLHSName(Expression* expression,
On 2011/01/26 08:03:59, Lasse Reichstein wrote:
> I prefer LValue to LHS. We *try*, without being completely successful, to
avoid
> abbreviations in names, except where the abbreviation is the common way to
refer
> to the concept (e.g., JSON, ASCII, etc.) 
> To me LValue is a canonical name, but LHS is just an abbreviation. That's
> obviously purely subjective :)

Renamed to CheckStrictModeLValue

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

http://codereview.chromium.org/6335013/diff/1/test/mjsunit/strict-mode.js#new...
test/mjsunit/strict-mode.js:187: 
On 2011/01/26 08:03:59, Lasse Reichstein wrote:
> Try a compound assignment operator as well, e.g., "-=".

Done.

http://codereview.chromium.org/6335013/diff/1/test/mjsunit/strict-mode.js#new...
test/mjsunit/strict-mode.js:218: CheckStrictMode("function strict() { var x =
--arguments; }", SyntaxError)
On 2011/01/26 08:03:59, Lasse Reichstein wrote:
> Check that not-lvalue-operand operators doesn't throw, e.g., "!" or "-".

Done.

Powered by Google App Engine
This is Rietveld 408576698