Ignore:
Timestamp:
Dec 7, 2009, 5:50:57 AM (15 years ago)
Author:
[email protected]
Message:

Object.create fails if properties on the descriptor are getters
https://bugs.webkit.org/show_bug.cgi?id=32219

Reviewed by Maciej Stachowiak.

Correctly initialise the PropertySlots with the descriptor object.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/ObjectConstructor.cpp

    r49734 r51760  
    149149    JSObject* description = asObject(in);
    150150
    151     PropertySlot enumerableSlot;
     151    PropertySlot enumerableSlot(description);
    152152    if (description->getPropertySlot(exec, exec->propertyNames().enumerable, enumerableSlot)) {
    153153        desc.setEnumerable(enumerableSlot.getValue(exec, exec->propertyNames().enumerable).toBoolean(exec));
     
    156156    }
    157157
    158     PropertySlot configurableSlot;
     158    PropertySlot configurableSlot(description);
    159159    if (description->getPropertySlot(exec, exec->propertyNames().configurable, configurableSlot)) {
    160160        desc.setConfigurable(configurableSlot.getValue(exec, exec->propertyNames().configurable).toBoolean(exec));
     
    164164
    165165    JSValue value;
    166     PropertySlot valueSlot;
     166    PropertySlot valueSlot(description);
    167167    if (description->getPropertySlot(exec, exec->propertyNames().value, valueSlot)) {
    168168        desc.setValue(valueSlot.getValue(exec, exec->propertyNames().value));
     
    171171    }
    172172
    173     PropertySlot writableSlot;
     173    PropertySlot writableSlot(description);
    174174    if (description->getPropertySlot(exec, exec->propertyNames().writable, writableSlot)) {
    175175        desc.setWritable(writableSlot.getValue(exec, exec->propertyNames().writable).toBoolean(exec));
     
    178178    }
    179179
    180     PropertySlot getSlot;
     180    PropertySlot getSlot(description);
    181181    if (description->getPropertySlot(exec, exec->propertyNames().get, getSlot)) {
    182182        JSValue get = getSlot.getValue(exec, exec->propertyNames().get);
     
    194194    }
    195195
    196     PropertySlot setSlot;
     196    PropertySlot setSlot(description);
    197197    if (description->getPropertySlot(exec, exec->propertyNames().set, setSlot)) {
    198198        JSValue set = setSlot.getValue(exec, exec->propertyNames().set);
Note: See TracChangeset for help on using the changeset viewer.