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

Issue 3137041: Fixes bug in Object.freeze and Object.seal causing them to misbehave when Arr... (Closed)

Created:
10 years, 4 months ago by Rico
Modified:
9 years, 6 months ago
Reviewers:
Erik Corry, Mark Lam
CC:
v8-dev
Visibility:
Public.

Description

Fixes bug in Object.freeze and Object.seal causing them to misbehave when Array.prototype has changed. Object.freeze and Object.seal uses GetOwnPropertyNames which returns an array with local property names. This array will also have the additional properties defined on Array.prototype or Object.prototype. Note that, the implementation of GetOwnPropertyNames (when used as Object.getOwnPropertyNames) is correct, since the spec says to create a new Array (which would also have these properties). Committed: http://code.google.com/p/v8/source/detail?r=5350

Patch Set 1 #

Patch Set 2 : '' #

Total comments: 2

Patch Set 3 : '' #

Unified diffs Side-by-side diffs Delta from patch set Stats (+49 lines, -9 lines) Patch
M src/v8natives.js View 1 2 4 chunks +9 lines, -9 lines 0 comments Download
A test/mjsunit/regress/regress-842.js View 1 chunk +40 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Rico
10 years, 4 months ago (2010-08-26 06:44:05 UTC) #1
Mark Lam
http://codereview.chromium.org/3137041/diff/2001/3001 File src/v8natives.js (right): http://codereview.chromium.org/3137041/diff/2001/3001#newcode751 src/v8natives.js:751: if (!IS_UNDEFINED(desc)) { Drive by comment: is there no ...
10 years, 4 months ago (2010-08-26 06:55:11 UTC) #2
Rico
Thanks for the comments, I will consider doing another change later on optimizing this (and ...
10 years, 4 months ago (2010-08-26 07:13:09 UTC) #3
Rico
Erik: As discussed offline, I changed the "for var in" loop to a loop using ...
10 years, 4 months ago (2010-08-26 08:09:01 UTC) #4
Erik Corry
10 years, 4 months ago (2010-08-26 08:17:16 UTC) #5
LGTM.

See also http://jsperf.com/for-vs-each-hash-vs-array for why this is a good
change

Powered by Google App Engine
This is Rietveld 408576698