Reviewers: Mads Ager,
Description:
Do not set value on host objects in Object.defineProperty (fixes issue
1250).
To be compatible with safari we should not change the value on API
objects in Object.defineProperty (e.g., the window.location object).
Please review this at http://codereview.chromium.org/6673042/
SVN Base: http://v8.googlecode.com/svn/branches/bleeding_edge/
Affected files:
M src/runtime.cc
Index: src/runtime.cc
===================================================================
--- src/runtime.cc (revision 7168)
+++ src/runtime.cc (working copy)
@@ -3762,6 +3762,14 @@
LookupResult result;
js_object->LookupRealNamedProperty(*name, &result);
+ // To be compatible with safari we do not change the value on API objects
+ // in defineProperty. Firefox disagrees here, and actually changes the
value.
+ if (result.IsProperty() &&
+ (result.type() == CALLBACKS) &&
+ result.GetCallbackObject()->IsAccessorInfo()) {
+ return Heap::undefined_value();
+ }
+
// Take special care when attributes are different and there is already
// a property. For simplicity we normalize the property which enables us
// to not worry about changing the instance_descriptor and creating a new
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev