Commit abfe4880 authored by darin@apple.com's avatar darin@apple.com

2008-06-24 Darin Adler <darin@apple.com>

        Reviewed by Cameron.

        - fix https://bugs.webkit.org/show_bug.cgi?id=19739
          REGRESSION: fast/js/property-getters-and-setters.html fails

        * kjs/JSObject.cpp:
        (KJS::JSObject::put): Remove an untested optimization I checked in by accident.
        The two loops up the prototype chain both need to start from this; instead the
        second loop was starting where the first loop left off.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@34773 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent dcd1fa72
2008-06-24 Darin Adler <darin@apple.com>
Reviewed by Cameron.
- fix https://bugs.webkit.org/show_bug.cgi?id=19739
REGRESSION: fast/js/property-getters-and-setters.html fails
* kjs/JSObject.cpp:
(KJS::JSObject::put): Remove an untested optimization I checked in by accident.
The two loops up the prototype chain both need to start from this; instead the
second loop was starting where the first loop left off.
2008-06-24 Steve Falkenburg <sfalken@apple.com>
Build fix.
......
......@@ -113,9 +113,8 @@ void JSObject::put(ExecState* exec, const Identifier& propertyName, JSValue* val
}
// Check if there are any setters or getters in the prototype chain
JSObject* obj;
JSValue* prototype;
for (obj = this; !obj->_prop.hasGetterSetterProperties(); obj = static_cast<JSObject*>(prototype)) {
for (JSObject* obj = this; !obj->_prop.hasGetterSetterProperties(); obj = static_cast<JSObject*>(prototype)) {
prototype = obj->_proto;
if (prototype == jsNull()) {
_prop.put(propertyName, value, 0, true);
......@@ -127,7 +126,7 @@ void JSObject::put(ExecState* exec, const Identifier& propertyName, JSValue* val
if (_prop.get(propertyName, attributes) && attributes & ReadOnly)
return;
for (; ; obj = static_cast<JSObject*>(prototype)) {
for (JSObject* obj = this; ; obj = static_cast<JSObject*>(prototype)) {
if (JSValue* gs = obj->_prop.get(propertyName, attributes)) {
if (attributes & IsGetterSetter) {
JSObject* setterFunc = static_cast<GetterSetter*>(gs)->setter();
......
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