Title: [99136] trunk
Revision
99136
Author
[email protected]
Date
2011-11-02 21:17:54 -0700 (Wed, 02 Nov 2011)

Log Message

Source/_javascript_Core: Object.getOwnPropertyDescriptor() does not retrieve the getter/setter from a property on the window that has been overridden with a getter/setter
https://bugs.webkit.org/show_bug.cgi?id=71333

Reviewed by Gavin Barraclough.

Tested by fast/dom/getter-on-window-object2.html

* runtime/PropertyDescriptor.cpp:
(JSC::PropertyDescriptor::setDescriptor):
The attributes returned from Structure::get do not include Getter or Setter, so
instead check if the value is a GetterSetter like we do elsewhere. If it is, update
the descriptor's attributes accordingly.

LayoutTests: Object.getOwnPropertyDescriptor() does not retrieve the getter/setter from a property on the window that has been overridden with a getter/setter/
https://bugs.webkit.org/show_bug.cgi?id=71333

Reviewed by Gavin Barraclough.

* fast/dom/getter-on-window-object2-expected.txt:
Update for now correct results.

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (99135 => 99136)


--- trunk/LayoutTests/ChangeLog	2011-11-03 03:33:38 UTC (rev 99135)
+++ trunk/LayoutTests/ChangeLog	2011-11-03 04:17:54 UTC (rev 99136)
@@ -1,3 +1,13 @@
+2011-11-02  Sam Weinig  <[email protected]>
+
+        Object.getOwnPropertyDescriptor() does not retrieve the getter/setter from a property on the window that has been overridden with a getter/setter/
+        https://bugs.webkit.org/show_bug.cgi?id=71333
+
+        Reviewed by Gavin Barraclough.
+
+        * fast/dom/getter-on-window-object2-expected.txt:
+        Update for now correct results.
+
 2011-11-02  Erik Arvidsson  <[email protected]>
 
         Add new StorageInfo test to the respective skip lists.

Modified: trunk/LayoutTests/fast/dom/getter-on-window-object2-expected.txt (99135 => 99136)


--- trunk/LayoutTests/fast/dom/getter-on-window-object2-expected.txt	2011-11-03 03:33:38 UTC (rev 99135)
+++ trunk/LayoutTests/fast/dom/getter-on-window-object2-expected.txt	2011-11-03 04:17:54 UTC (rev 99136)
@@ -12,12 +12,12 @@
 PASS typeof Object.getOwnPropertyDescriptor(window, 'x').get is 'undefined'
 
 PASS window.y is 'window.y __getter__'
-FAIL typeof window.__lookupGetter__('y') should be function. Was undefined.
-FAIL typeof Object.getOwnPropertyDescriptor(window, 'y').get should be function. Was undefined.
+PASS typeof window.__lookupGetter__('y') is 'function'
+PASS typeof Object.getOwnPropertyDescriptor(window, 'y').get is 'function'
 
 PASS window.y is 'window.y __getter__'
-FAIL typeof window.__lookupGetter__('y') should be function. Was undefined.
-FAIL typeof Object.getOwnPropertyDescriptor(window, 'y').get should be function. Was undefined.
+PASS typeof window.__lookupGetter__('y') is 'function'
+PASS typeof Object.getOwnPropertyDescriptor(window, 'y').get is 'function'
 
 PASS window.z is undefined.
 PASS typeof window.__lookupSetter__('z') is 'function'

Modified: trunk/Source/_javascript_Core/ChangeLog (99135 => 99136)


--- trunk/Source/_javascript_Core/ChangeLog	2011-11-03 03:33:38 UTC (rev 99135)
+++ trunk/Source/_javascript_Core/ChangeLog	2011-11-03 04:17:54 UTC (rev 99136)
@@ -1,3 +1,18 @@
+2011-11-02  Sam Weinig  <[email protected]>
+
+        Object.getOwnPropertyDescriptor() does not retrieve the getter/setter from a property on the window that has been overridden with a getter/setter
+        https://bugs.webkit.org/show_bug.cgi?id=71333
+
+        Reviewed by Gavin Barraclough.
+
+        Tested by fast/dom/getter-on-window-object2.html
+
+        * runtime/PropertyDescriptor.cpp:
+        (JSC::PropertyDescriptor::setDescriptor):
+        The attributes returned from Structure::get do not include Getter or Setter, so
+        instead check if the value is a GetterSetter like we do elsewhere. If it is, update
+        the descriptor's attributes accordingly.
+
 2011-11-02  Yuqiang Xian  <[email protected]>
 
         FunctionPtr should accept FASTCALL functions on X86

Modified: trunk/Source/_javascript_Core/runtime/PropertyDescriptor.cpp (99135 => 99136)


--- trunk/Source/_javascript_Core/runtime/PropertyDescriptor.cpp	2011-11-03 03:33:38 UTC (rev 99135)
+++ trunk/Source/_javascript_Core/runtime/PropertyDescriptor.cpp	2011-11-03 04:17:54 UTC (rev 99136)
@@ -88,10 +88,17 @@
 {
     ASSERT(value);
     m_attributes = attributes;
-    if (attributes & (Getter | Setter)) {
+    if (value.isGetterSetter()) {
         GetterSetter* accessor = asGetterSetter(value);
+
         m_getter = accessor->getter();
+        if (m_getter)
+            m_attributes |= Getter;
+
         m_setter = accessor->setter();
+        if (m_setter)
+            m_attributes |= Setter;
+
         ASSERT(m_getter || m_setter);
         m_seenAttributes = EnumerablePresent | ConfigurablePresent;
         m_attributes &= ~ReadOnly;
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to