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 6515005: Strict mode delete. (Closed)

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

Description

Strict mode delete. (includes delete of unqualified identifier) Pass strict mode flag to Runtime_DeleteProperty and then via STRICT_DELETION to JSObject::Delete(Property/Element). Throw TypeError when deleting non configurable property/element. Adding mozilla test to .gitignore. BUG= TEST=test/mjsunit/strict-mode.js

Patch Set 1 #

Total comments: 19
Unified diffs Side-by-side diffs Delta from patch set Stats (+131 lines, -30 lines) Patch
M .gitignore View 1 chunk +1 line, -0 lines 0 comments Download
M src/arm/codegen-arm.cc View 1 chunk +5 lines, -2 lines 4 comments Download
M src/arm/full-codegen-arm.cc View 1 chunk +7 lines, -3 lines 4 comments Download
M src/arm/lithium-codegen-arm.h View 1 chunk +4 lines, -0 lines 0 comments Download
M src/arm/lithium-codegen-arm.cc View 1 chunk +3 lines, -1 line 2 comments Download
M src/builtins.h View 1 chunk +1 line, -1 line 0 comments Download
M src/ia32/codegen-ia32.cc View 1 chunk +5 lines, -2 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.h View 1 chunk +4 lines, -0 lines 0 comments Download
M src/ia32/lithium-codegen-ia32.cc View 1 chunk +1 line, -0 lines 0 comments Download
M src/messages.js View 1 chunk +2 lines, -0 lines 0 comments Download
M src/objects.h View 1 chunk +6 lines, -1 line 1 comment Download
M src/objects.cc View 4 chunks +16 lines, -3 lines 3 comments Download
M src/parser.cc View 1 chunk +10 lines, -0 lines 1 comment Download
M src/runtime.h View 1 chunk +1 line, -1 line 0 comments Download
M src/runtime.cc View 1 chunk +5 lines, -2 lines 0 comments Download
M src/runtime.js View 1 chunk +2 lines, -2 lines 0 comments Download
M src/x64/codegen-x64.cc View 1 chunk +5 lines, -2 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 1 chunk +3 lines, -0 lines 0 comments Download
M test/es5conform/es5conform.status View 1 chunk +9 lines, -10 lines 0 comments Download
M test/mjsunit/strict-mode.js View 2 chunks +38 lines, -0 lines 4 comments Download

Messages

Total messages: 4 (0 generated)
Martin Maly
The second part of implementation of delete behavior in strict mode (deleting non-configurable property). This ...
9 years, 10 months ago (2011-02-14 05:15:22 UTC) #1
Mads Ager (chromium)
LGTM http://codereview.chromium.org/6515005/diff/1/src/arm/codegen-arm.cc File src/arm/codegen-arm.cc (right): http://codereview.chromium.org/6515005/diff/1/src/arm/codegen-arm.cc#newcode5852 src/arm/codegen-arm.cc:5852: ASSERT(strict_mode_flag() == kNonStrictMode); On 2011/02/14 05:15:22, Martin Maly ...
9 years, 10 months ago (2011-02-14 10:27:24 UTC) #2
Kevin Millikin (Chromium)
http://codereview.chromium.org/6515005/diff/1/src/arm/codegen-arm.cc File src/arm/codegen-arm.cc (right): http://codereview.chromium.org/6515005/diff/1/src/arm/codegen-arm.cc#newcode5852 src/arm/codegen-arm.cc:5852: ASSERT(strict_mode_flag() == kNonStrictMode); On 2011/02/14 10:27:24, Mads Ager wrote: ...
9 years, 10 months ago (2011-02-14 11:56:55 UTC) #3
Martin Maly
9 years, 10 months ago (2011-02-14 21:46:51 UTC) #4
Incorporated the feedback. Thank you!
Martin

http://codereview.chromium.org/6515005/diff/1/src/arm/codegen-arm.cc
File src/arm/codegen-arm.cc (right):

http://codereview.chromium.org/6515005/diff/1/src/arm/codegen-arm.cc#newcode5852
src/arm/codegen-arm.cc:5852: ASSERT(strict_mode_flag() == kNonStrictMode);
On 2011/02/14 10:27:24, Mads Ager wrote:
> On 2011/02/14 05:15:22, Martin Maly wrote:
> > "delete foo" is disallowed in strict mode so we can only reach this code in
> > non-strict mode.
> 
> And 'this' rewrites to a slot, right?
> 
> Also, could you put in your review comment here as a code comment to make it
> clearer when reading this code later?

Yes, this rewrites to a slot.
Added comment.

http://codereview.chromium.org/6515005/diff/1/src/arm/full-codegen-arm.cc
File src/arm/full-codegen-arm.cc (right):

http://codereview.chromium.org/6515005/diff/1/src/arm/full-codegen-arm.cc#new...
src/arm/full-codegen-arm.cc:3072: ASSERT(strict_mode_flag() == kNonStrictMode);
On 2011/02/14 10:27:24, Mads Ager wrote:
> Maybe duplicate the comment here to explain the assert?

Done.

http://codereview.chromium.org/6515005/diff/1/src/objects.cc
File src/objects.cc (right):

http://codereview.chromium.org/6515005/diff/1/src/objects.cc#newcode2623
src/objects.cc:2623: Object* result = dictionary->DeleteProperty(entry, mode);
On 2011/02/14 10:27:24, Mads Ager wrote:
> On 2011/02/14 05:15:22, Martin Maly wrote:
> > DeleteProperty is a wrong place to report the error because it is missing
the
> > necessary data to report good error, and it is called from other places
which
> > don't even have the relevant information.
> > Checking for false_value() for strict mode delete felt cleanest.
> 
> I think that makes sense. Could you add a comment in the body of the if
> statement that deleting non-configurable properties in strict mode should
throw
> exceptions?
> 

Done.

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

http://codereview.chromium.org/6515005/diff/1/test/mjsunit/strict-mode.js#new...
test/mjsunit/strict-mode.js:267: // Delete of an unqialified identifier
On 2011/02/14 10:27:24, Mads Ager wrote:
> unqialified -> unqualified

Done.

http://codereview.chromium.org/6515005/diff/1/test/mjsunit/strict-mode.js#new...
test/mjsunit/strict-mode.js:270: CheckStrictMode("function function_name() {
delete function_name; }", SyntaxError);
On 2011/02/14 10:27:24, Mads Ager wrote:
> Make these 80 char lines?

Done.

Powered by Google App Engine
This is Rietveld 408576698