Commit 151b90da authored by weinig@apple.com's avatar weinig@apple.com

Source/JavaScriptCore: Object.getOwnPropertyDescriptor() does not retrieve the...

Source/JavaScriptCore: 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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@99136 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 555f7622
2011-11-02 Sam Weinig <sam@webkit.org>
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 <arv@chromium.org>
Add new StorageInfo test to the respective skip lists.
......@@ -12,12 +12,12 @@ PASS typeof window.__lookupGetter__('x') is 'undefined'
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'
......
2011-11-02 Sam Weinig <sam@webkit.org>
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 <yuqiang.xian@intel.com>
FunctionPtr should accept FASTCALL functions on X86
......@@ -88,10 +88,17 @@ void PropertyDescriptor::setDescriptor(JSValue value, unsigned attributes)
{
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment