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

Issue 7044104: Fix issue 1447 by not redefining properties unneccesarily in seal and freeze. (Closed)

Created:
9 years, 6 months ago by Mads Ager (chromium)
Modified:
9 years, 6 months ago
Reviewers:
Lasse Reichstein
CC:
v8-dev
Visibility:
Public.

Description

Fix issue 1447 by not redefining properties unneccesarily in seal and freeze. This avoids attempting to redefine function.arguments with a different value than the current one. function.arguments returns a new copy on each invocation. R=lrn@chromium.org BUG=v8:1447 TEST=mjsunit/regress/regress-1447.js Committed: http://code.google.com/p/v8/source/detail?r=8258

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+32 lines, -1 line) Patch
M src/v8natives.js View 2 chunks +3 lines, -1 line 4 comments Download
A test/mjsunit/regress/regress-1447.js View 1 chunk +29 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Mads Ager (chromium)
9 years, 6 months ago (2011-06-10 08:34:19 UTC) #1
Lasse Reichstein
LGTM http://codereview.chromium.org/7044104/diff/1/src/v8natives.js File src/v8natives.js (right): http://codereview.chromium.org/7044104/diff/1/src/v8natives.js#newcode942 src/v8natives.js:942: desc.setConfigurable(false); Make it if (desc.isConfigurable()) { ... } ...
9 years, 6 months ago (2011-06-10 09:09:10 UTC) #2
Mads Ager (chromium)
9 years, 6 months ago (2011-06-10 09:13:41 UTC) #3
http://codereview.chromium.org/7044104/diff/1/src/v8natives.js
File src/v8natives.js (right):

http://codereview.chromium.org/7044104/diff/1/src/v8natives.js#newcode942
src/v8natives.js:942: desc.setConfigurable(false);
On 2011/06/10 09:09:10, Lasse Reichstein wrote:
> Make it 
>  if (desc.isConfigurable()) {
>    ...
>  }
> instead of using continue. More readable, since it makes control flow visible
by
> indentation.

Done.

http://codereview.chromium.org/7044104/diff/1/src/v8natives.js#newcode958
src/v8natives.js:958: if (!desc.isWritable() && !desc.isConfigurable())
continue;
On 2011/06/10 09:09:10, Lasse Reichstein wrote:
> Ditto here: invert the condition and put the rest of the loop inside the if.
And
> drop the tests before setting Writable and Configurable to false.

Done.

Powered by Google App Engine
This is Rietveld 408576698