Issue 2383 in v8: assignment to index property fails to fail when property on prototype is non-writable

2 views
Skip to first unread message

codesite...@google.com

unread,
Oct 29, 2012, 8:52:11 AM10/29/12
to v8-...@googlegroups.com
Status: New
Owner: ----

New issue 2383 by raf...@chromium.org: assignment to index property fails
to fail when property on prototype is non-writable
http://code.google.com/p/v8/issues/detail?id=2383

var foo = {};
var proto = {};
foo.__proto__ = proto;
Object.defineProperty(proto, 'str', { writable: false, value: 'fixed' });
foo.str = 'changed';
foo.str; // 'fixed', i.e. rejects the [[Put]]
Object.defineProperty(proto, '0', { writable: false, value: 'fixed' });
foo[0] = 'changed';
foo[0]; // 'changed', i.e. the property was set on the local object.

[FYI, index properties appear to the do the right thing with accessors on
the prototype]

codesite...@google.com

unread,
Oct 29, 2012, 2:37:43 PM10/29/12
to v8-...@googlegroups.com

Comment #1 on issue 2383 by metaw...@gmail.com: assignment to index
property fails to fail when property on prototype is non-writable
http://code.google.com/p/v8/issues/detail?id=2383

Lots of background information and links to discussion here:
http://wiki.ecmascript.org/doku.php?id=strawman:fixing_override_mistake

codesite...@google.com

unread,
Oct 29, 2012, 2:40:45 PM10/29/12
to v8-...@googlegroups.com

Comment #2 on issue 2383 by metaw...@gmail.com: assignment to index
property fails to fail when property on prototype is non-writable
http://code.google.com/p/v8/issues/detail?id=2383

See also http://code.google.com/p/v8/issues/detail?id=1169

codesite...@google.com

unread,
Oct 31, 2012, 5:10:42 AM10/31/12
to v8-...@googlegroups.com
Updates:
Status: Accepted
Cc: mstar...@chromium.org rossb...@chromium.org
Labels: Type-Bug Priority-Low ES5

Comment #3 on issue 2383 by mstar...@chromium.org: assignment to index
property fails to fail when property on prototype is non-writable
http://code.google.com/p/v8/issues/detail?id=2383

(No comment was entered for this change.)

codesite...@google.com

unread,
Jul 4, 2015, 6:09:55 AM7/4/15
to v8-...@googlegroups.com

Comment #5 on issue 2383 by sulf...@gmail.com: assignment to index property
fails to fail when property on prototype is non-writable
https://code.google.com/p/v8/issues/detail?id=2383

What a pitty that issue #1169 was "fixed". It is the specification that
should be fixed!!

In a few words, it's nonsense to protect a property from being set,
judgeing by the attributes of ANOTHER object's property.
The argument that the other object is the prototype of the former doesn't
hold, as the inheritance of the [[Writable]] attribute MUST then be
accompanied by WRITE ACCESS to the "inherited" property, which is not the
case - you can never set a new value for the inherited property, you can
only hide that value with a property with the same name.

Sorry, I couldn't help.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

codesite...@google.com

unread,
Jul 17, 2015, 5:47:04 PM7/17/15
to v8-...@googlegroups.com
Updates:
Status: Fixed
Owner: verwa...@chromium.org

Comment #6 on issue 2383 by ad...@chromium.org: assignment to index
property fails to fail when property on prototype is non-writable
https://code.google.com/p/v8/issues/detail?id=2383

I think Toon recently fixed this one.
Reply all
Reply to author
Forward
0 new messages