Ignore:
Timestamp:
Jun 12, 2012, 12:08:14 AM (13 years ago)
Author:
[email protected]
Message:

Property names of the built-in object cannot be retrieved
after trying to delete one of its properties
https://bugs.webkit.org/show_bug.cgi?id=86461

Patch by Hojong Han <[email protected]> on 2012-06-12
Reviewed by Gavin Barraclough.

Source/JavaScriptCore:

  • runtime/JSObject.cpp:

(JSC::getClassPropertyNames):
(JSC::JSObject::getOwnPropertyNames):

LayoutTests:

  • fast/js/delete-syntax-expected.txt:
  • fast/js/script-tests/delete-syntax.js:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSObject.cpp

    r119865 r120045  
    5757const ClassInfo JSFinalObject::s_info = { "Object", &Base::s_info, 0, 0, CREATE_METHOD_TABLE(JSFinalObject) };
    5858
    59 static inline void getClassPropertyNames(ExecState* exec, const ClassInfo* classInfo, PropertyNameArray& propertyNames, EnumerationMode mode)
     59static inline void getClassPropertyNames(ExecState* exec, const ClassInfo* classInfo, PropertyNameArray& propertyNames, EnumerationMode mode, bool didReify)
    6060{
    6161    // Add properties from the static hashtables of properties
     
    7070        const HashEntry* entry = table->table;
    7171        for (int i = 0; i <= hashSizeMask; ++i, ++entry) {
    72             if (entry->key() && (!(entry->attributes() & DontEnum) || (mode == IncludeDontEnumProperties)))
     72            if (entry->key() && (!(entry->attributes() & DontEnum) || (mode == IncludeDontEnumProperties)) && !((entry->attributes() & Function) && didReify))
    7373                propertyNames.add(entry->key());
    7474        }
     
    418418void JSObject::getOwnPropertyNames(JSObject* object, ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)
    419419{
    420     if (!object->staticFunctionsReified())
    421         getClassPropertyNames(exec, object->classInfo(), propertyNames, mode);
     420    getClassPropertyNames(exec, object->classInfo(), propertyNames, mode, object->staticFunctionsReified());
    422421    object->structure()->getPropertyNamesFromStructure(exec->globalData(), propertyNames, mode);
    423422}
Note: See TracChangeset for help on using the changeset viewer.