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

Issue 6613005: Implementation of strict mode in SetElement. (Closed)

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

Description

Implementation of strict mode in SetElement. Passing strict mode throughout SetElement. Throw if assigning to read only element. Adding tests for element assignment in strict mode. Fix tests for strict mode SetElement. BUG=http://code.google.com/p/v8/issues/detail?id=1220 TEST=test/mjsunit/strict-mode.js

Patch Set 1 : SetElement and strict mode. #

Total comments: 6

Patch Set 2 : SetElement in strict mode. #

Total comments: 1

Patch Set 3 : Fix presubmit and merge conflicts. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+2 lines, -1 line) Patch
M src/runtime.cc View 1 2 1 chunk +2 lines, -1 line 0 comments Download

Messages

Total messages: 4 (0 generated)
Martin Maly
The remainder of the 'assignment to read only property" implementation - SetElement. Thank you! Martin ...
9 years, 9 months ago (2011-03-03 06:07:56 UTC) #1
Lasse Reichstein
LGTM http://codereview.chromium.org/6613005/diff/2001/src/runtime.cc File src/runtime.cc (right): http://codereview.chromium.org/6613005/diff/2001/src/runtime.cc#newcode8675 src/runtime.cc:8675: SetElement(jsobject, index1, tmp2, kNonStrictMode); It's used only internally ...
9 years, 9 months ago (2011-03-03 09:39:50 UTC) #2
Lasse Reichstein
http://codereview.chromium.org/6613005/diff/2001/src/runtime.cc File src/runtime.cc (right): http://codereview.chromium.org/6613005/diff/2001/src/runtime.cc#newcode8675 src/runtime.cc:8675: SetElement(jsobject, index1, tmp2, kNonStrictMode); My bad, the spec is ...
9 years, 9 months ago (2011-03-03 09:44:53 UTC) #3
Martin Maly
9 years, 9 months ago (2011-03-04 00:36:09 UTC) #4
Thanks for the feedback. Landed. Hopefully webkit tests will pass (ran the set
that triggered last locally with success).

Thanks!
Martin

http://codereview.chromium.org/6613005/diff/2001/src/runtime.cc
File src/runtime.cc (right):

http://codereview.chromium.org/6613005/diff/2001/src/runtime.cc#newcode8675
src/runtime.cc:8675: SetElement(jsobject, index1, tmp2, kNonStrictMode);
On 2011/03/03 09:39:50, Lasse Reichstein wrote:
> It's used only internally in the Array.prototype.sort implementation, and
that's
> defined as doing a sequence of [[Get]], [[Put]], [[Delete]] and calls to the
> compare function, where the "throw" argument to [[Put]] must be true.
> I.e., we should throw if [[Put]](i,v,true) would throw (ES5 8.12.5, refers to
> [[CanPut]], 8.12.14) which is when there is either no setter for an accessor
> property or if [[Writable]] is false for a data accessor.
> Or if the object isn't extensible (frozen), unless it inherits a setter
> accessor.
> Or some more twisted logic.
> 
> (I think the [[CanPut]] spec is wrong, it sees to only consider the immediate
> prototype in the prototype chain).
> 
> In any case, I would go kStrictMode here and see if it breaks anything.
> Never sort with write-only properties in your array!

Done. Strict mode worked just fine.

Powered by Google App Engine
This is Rietveld 408576698