From 03e12282df9aa1e1fb05a8b90f1cfc2e08764cec Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 9 Feb 2012 14:16:12 +0100 Subject: Imported WebKit commit e09a82039aa4273ab318b71122e92d8e5f233525 (http://svn.webkit.org/repository/webkit/trunk@107223) --- Source/JavaScriptCore/runtime/JSGlobalObject.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'Source/JavaScriptCore/runtime/JSGlobalObject.cpp') 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(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(object); - PropertySlot slot; - if (!thisObject->symbolTableGet(propertyName, slot)) - JSVariableObject::defineSetter(thisObject, exec, propertyName, setterFunc, attributes); -} static inline JSObject* lastInPrototypeChain(JSObject* object) { -- cgit v1.2.1