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

Issue 8996008: Fix handling of foreign callbacks in DefineOwnProperty. (Closed)

Created:
9 years ago by Michael Starzinger
Modified:
9 years ago
Reviewers:
rossberg
CC:
v8-dev
Visibility:
Public.

Description

Fix handling of foreign callbacks in DefineOwnProperty. We use foreign callbacks to make some properties shadow internal values but still behave as data properties from within JavaScript. This means when a value is passed to Object.defineProperty() on such a property, it should update the internal value instead of redefinind the property and destroying the shadowing. R=rossberg@chromium.org BUG=v8:1530 TEST=mjsunit/regress/regress-1530,test262/S15.3.3.1_A4 Committed: http://code.google.com/p/v8/source/detail?r=10279

Patch Set 1 #

Total comments: 6

Patch Set 2 : Addressed comments by Andreas Rossberg. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -9 lines) Patch
M src/runtime.cc View 1 1 chunk +20 lines, -6 lines 0 comments Download
A test/mjsunit/regress/regress-1530.js View 1 1 chunk +69 lines, -0 lines 0 comments Download
M test/test262/test262.status View 1 chunk +0 lines, -3 lines 0 comments Download

Messages

Total messages: 2 (0 generated)
rossberg
lgtm http://codereview.chromium.org/8996008/diff/1/src/runtime.cc File src/runtime.cc (right): http://codereview.chromium.org/8996008/diff/1/src/runtime.cc#newcode4333 src/runtime.cc:4333: // in defineProperty. Firefox disagrees here, and actually ...
9 years ago (2011-12-19 16:47:44 UTC) #1
Michael Starzinger
9 years ago (2011-12-20 08:50:16 UTC) #2
Added new patch set. Landed.

http://codereview.chromium.org/8996008/diff/1/src/runtime.cc
File src/runtime.cc (right):

http://codereview.chromium.org/8996008/diff/1/src/runtime.cc#newcode4333
src/runtime.cc:4333: // in defineProperty. Firefox disagrees here, and actually
changes the value.
On 2011/12/19 16:47:44, rossberg wrote:
> 80 characters

Done.

http://codereview.chromium.org/8996008/diff/1/src/runtime.cc#newcode4346
src/runtime.cc:4346: kNonStrictMode);
On 2011/12/19 16:47:44, rossberg wrote:
> This should be KStrictMode, I think.

Done. On this code path it doesn't actually matter. The mode is only considered
for JavaScript accessors, but not for API nor foreign callbacks.

http://codereview.chromium.org/8996008/diff/1/test/mjsunit/regress/regress-15...
File test/mjsunit/regress/regress-1530.js (right):

http://codereview.chromium.org/8996008/diff/1/test/mjsunit/regress/regress-15...
test/mjsunit/regress/regress-1530.js:28: // Test that redefining the 'prototype'
property of a function object
On 2011/12/19 16:47:44, rossberg wrote:
> Maybe test other magic properties of functions, too?

Done. All other properties of function objects for which we use foreign
callbacks are non-writable, but I added checks that Object.defineProperty()
throws on them as expected.

Powered by Google App Engine
This is Rietveld 408576698