diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-09 14:16:12 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-02-09 14:16:12 +0100 |
commit | 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec (patch) | |
tree | 52599cd0ab782b1768e23ad176f7618f98333cb6 /Source/JavaScriptCore/runtime/JSGlobalObject.cpp | |
parent | cd44dc59cdfc39534aef4d417e9f3c412e3be139 (diff) | |
download | qtwebkit-03e12282df9aa1e1fb05a8b90f1cfc2e08764cec.tar.gz |
Imported WebKit commit e09a82039aa4273ab318b71122e92d8e5f233525 (http://svn.webkit.org/repository/webkit/trunk@107223)
Diffstat (limited to 'Source/JavaScriptCore/runtime/JSGlobalObject.cpp')
-rw-r--r-- | Source/JavaScriptCore/runtime/JSGlobalObject.cpp | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp index f28139d27..e648fbe21 100644 --- a/Source/JavaScriptCore/runtime/JSGlobalObject.cpp +++ b/Source/JavaScriptCore/runtime/JSGlobalObject.cpp @@ -171,21 +171,16 @@ void JSGlobalObject::putDirectVirtual(JSObject* object, ExecState* exec, const I } } -void JSGlobalObject::defineGetter(JSObject* object, ExecState* exec, const Identifier& propertyName, JSObject* getterFunc, unsigned attributes) +bool JSGlobalObject::defineOwnProperty(JSObject* object, ExecState* exec, const Identifier& propertyName, PropertyDescriptor& descriptor, bool shouldThrow) { JSGlobalObject* thisObject = jsCast<JSGlobalObject*>(object); PropertySlot slot; - if (!thisObject->symbolTableGet(propertyName, slot)) - JSVariableObject::defineGetter(thisObject, exec, propertyName, getterFunc, attributes); + // silently ignore attempts to add accessors aliasing vars. + if (descriptor.isAccessorDescriptor() && thisObject->symbolTableGet(propertyName, slot)) + return false; + return Base::defineOwnProperty(thisObject, exec, propertyName, descriptor, shouldThrow); } -void JSGlobalObject::defineSetter(JSObject* object, ExecState* exec, const Identifier& propertyName, JSObject* setterFunc, unsigned attributes) -{ - JSGlobalObject* thisObject = jsCast<JSGlobalObject*>(object); - PropertySlot slot; - if (!thisObject->symbolTableGet(propertyName, slot)) - JSVariableObject::defineSetter(thisObject, exec, propertyName, setterFunc, attributes); -} static inline JSObject* lastInPrototypeChain(JSObject* object) { |