Chromium Code Reviews
Help | Chromium Project | Gerrit Changes | Sign in
(2448)

Issue 6144005: Early draft of strict mode (Closed)

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

Description

First part of strict mode. - var eval | arguments - catch (eval | arguments) - 'with' is disabled - function can't be named eval or arguments - function parameter name cannot be eval or arguments - no duplicate parameter names allowed Add FLAG_strict_mode

Patch Set 1 #

Total comments: 24

Patch Set 2 : Lasse's code review feedback + flag #

Total comments: 4

Patch Set 3 : More CR feedback. #

Total comments: 2

Patch Set 4 : CR Feedback + Tests. #

Total comments: 12

Patch Set 5 : Fix Mozilla test. #

Patch Set 6 : Removing parameter validation; #

Unified diffs Side-by-side diffs Delta from patch set Stats (+226 lines, -9 lines) Patch
M src/ast.h View 4 chunks +5 lines, -1 line 0 comments Download
M src/flag-definitions.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/heap.h View 1 chunk +2 lines, -1 line 0 comments Download
M src/messages.js View 1 chunk +7 lines, -1 line 0 comments Download
M src/parser.cc View 1 2 3 4 5 13 chunks +94 lines, -6 lines 0 comments Download
A test/mjsunit/strict-mode.js View 1 2 3 4 5 1 chunk +117 lines, -0 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
Martin Maly
the first early draft.
9 years, 8 months ago (2011-01-12 21:47:55 UTC) #1
Lasse Reichstein
I like this (i.e., it's very close to how I would have done it). The ...
9 years, 8 months ago (2011-01-13 07:18:30 UTC) #2
Lasse Reichstein
http://codereview.chromium.org/6144005/diff/1/src/parser.cc File src/parser.cc (right): http://codereview.chromium.org/6144005/diff/1/src/parser.cc#newcode1084 src/parser.cc:1084: if (peek() == Token::STRING) { Argh, location should be: ...
9 years, 8 months ago (2011-01-13 07:44:07 UTC) #3
Lasse Reichstein
After some thought, we think it will be a good idea to have a flag ...
9 years, 8 months ago (2011-01-13 10:29:52 UTC) #4
Evan Martin
FYI, here's an instance of needing to disable strict mode: https://bugs.webkit.org/show_bug.cgi?id=48377
9 years, 8 months ago (2011-01-13 18:36:02 UTC) #5
Martin Maly
Thanks for the feedback, Lasse! Tried to incorporate all of it, in few places I ...
9 years, 8 months ago (2011-01-14 00:06:27 UTC) #6
Lasse Reichstein
http://codereview.chromium.org/6144005/diff/1/src/parser.cc File src/parser.cc (right): http://codereview.chromium.org/6144005/diff/1/src/parser.cc#newcode1084 src/parser.cc:1084: if (peek() == Token::STRING) { I don't see how ...
9 years, 8 months ago (2011-01-14 11:42:04 UTC) #7
Martin Maly
Thank you for reviewing the code for me! Here it is updated per your feedback. ...
9 years, 8 months ago (2011-01-14 16:30:43 UTC) #8
Lasse Reichstein
LGTM. http://codereview.chromium.org/6144005/diff/1/src/parser.cc File src/parser.cc (right): http://codereview.chromium.org/6144005/diff/1/src/parser.cc#newcode1084 src/parser.cc:1084: if (peek() == Token::STRING) { Ack, yes, now ...
9 years, 8 months ago (2011-01-17 10:17:49 UTC) #9
Lasse Reichstein
http://codereview.chromium.org/6144005/diff/20001/src/parser.cc File src/parser.cc (right): http://codereview.chromium.org/6144005/diff/20001/src/parser.cc#newcode1076 src/parser.cc:1076: if (directive_prologue && peek() == Token::STRING) { So I ...
9 years, 8 months ago (2011-01-17 10:23:41 UTC) #10
Martin Maly
Made the change and added tests to cover the currently implemented strict mode checks. http://codereview.chromium.org/6144005/diff/20001/src/parser.cc ...
9 years, 8 months ago (2011-01-18 00:32:28 UTC) #11
Lasse Reichstein
LGTM. Let's try to commit it and see the impact! http://codereview.chromium.org/6144005/diff/32001/src/messages.js File src/messages.js (right): http://codereview.chromium.org/6144005/diff/32001/src/messages.js#newcode205 ...
9 years, 8 months ago (2011-01-18 13:40:58 UTC) #12
Martin Maly
Thanks, fixed these issues, added couple more tests and committed. Thank you! Martin http://codereview.chromium.org/6144005/diff/32001/src/messages.js File ...
9 years, 8 months ago (2011-01-18 16:46:38 UTC) #13
Martin Maly
The commit with n^2 algorithm for parameter validation caused timeout in Mozilla tests (function with ...
9 years, 8 months ago (2011-01-19 06:09:34 UTC) #14
Kevin Millikin (Chromium)
Methinks parameter validation doesn't belong in the parser. After parsing we resolve variables in scopes.cc, ...
9 years, 8 months ago (2011-01-19 07:54:58 UTC) #15
Martin Maly
9 years, 8 months ago (2011-01-19 16:34:06 UTC) #16
Removing the parameter validation for now, will find the right approach in
another patch.

Thank you!
Martin

Powered by Google App Engine
This is Rietveld 408576698