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

Issue 6598023: Strict mode - allow function only in SourceElements. (Closed)

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

Description

Strict mode - allow function only in SourceElements. BUG= TEST=test/mjsunit/strict-mode.js

Patch Set 1 #

Total comments: 4

Patch Set 2 : CR Feedback. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -2 lines) Patch
M src/messages.js View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/parser.cc View 1 2 chunks +24 lines, -2 lines 0 comments Download
M test/mjsunit/strict-mode.js View 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Martin Maly
Syntax error if function is in the block in strict mode. Only as part of ...
9 years, 10 months ago (2011-02-26 19:50:01 UTC) #1
Mads Ager (chromium)
LGTM http://codereview.chromium.org/6598023/diff/1/src/messages.js File src/messages.js (right): http://codereview.chromium.org/6598023/diff/1/src/messages.js#newcode229 src/messages.js:229: strict_function: ["In strict mode code, functions can only ...
9 years, 9 months ago (2011-02-28 08:30:12 UTC) #2
Martin Maly
9 years, 9 months ago (2011-02-28 18:57:33 UTC) #3
Applied the CR feedback. thanks!

Martin

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

http://codereview.chromium.org/6598023/diff/1/src/messages.js#newcode229
src/messages.js:229: strict_function:              ["In strict mode code,
functions can only be declared at top level or immediately within another
function." ],
On 2011/02/28 08:30:12, Mads Ager wrote:
> Seems like a very long (but informative) error message. The language here is
> very different from the other error messages. Can we use the same style:
> "Function declaration in local scope disallowed in strict mode" or something
> like that?

Done.

http://codereview.chromium.org/6598023/diff/1/src/parser.cc
File src/parser.cc (right):

http://codereview.chromium.org/6598023/diff/1/src/parser.cc#newcode1111
src/parser.cc:1111: if (peek() == Token::FUNCTION) {
On 2011/02/28 08:30:12, Mads Ager wrote:
> You should add a comment here as well to make it clear why this parse
statement
> call is treated specially. 

Done.

Powered by Google App Engine
This is Rietveld 408576698