Changeset 53170 in webkit
- Timestamp:
- Jan 12, 2010 4:58:21 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 48 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/API/JSCallbackObject.h
r49721 r53170 70 70 virtual bool hasInstance(ExecState* exec, JSValue value, JSValue proto); 71 71 72 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray& );72 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); 73 73 74 74 virtual double toNumber(ExecState*) const; -
trunk/JavaScriptCore/API/JSCallbackObjectFunctions.h
r52751 r53170 381 381 382 382 template <class Base> 383 void JSCallbackObject<Base>::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames )383 void JSCallbackObject<Base>::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 384 384 { 385 385 JSContextRef execRef = toRef(exec); … … 398 398 UString::Rep* name = it->first.get(); 399 399 StaticValueEntry* entry = it->second; 400 if (entry->getProperty && !(entry->attributes & kJSPropertyAttributeDontEnum))400 if (entry->getProperty && (!(entry->attributes & kJSPropertyAttributeDontEnum) || (mode == IncludeDontEnumProperties))) 401 401 propertyNames.add(Identifier(exec, name)); 402 402 } … … 409 409 UString::Rep* name = it->first.get(); 410 410 StaticFunctionEntry* entry = it->second; 411 if (!(entry->attributes & kJSPropertyAttributeDontEnum) )411 if (!(entry->attributes & kJSPropertyAttributeDontEnum) || (mode == IncludeDontEnumProperties)) 412 412 propertyNames.add(Identifier(exec, name)); 413 413 } … … 415 415 } 416 416 417 Base::getOwnPropertyNames(exec, propertyNames );417 Base::getOwnPropertyNames(exec, propertyNames, mode); 418 418 } 419 419 -
trunk/JavaScriptCore/ChangeLog
r53151 r53170 1 2010-01-12 Kent Hansen <kent.hansen@nokia.com> 2 3 Reviewed by Geoffrey Garen. 4 5 [ES5] Implement Object.getOwnPropertyNames 6 https://bugs.webkit.org/show_bug.cgi?id=32242 7 8 Add an extra argument to getPropertyNames() and getOwnPropertyNames() 9 (and all reimplementations thereof) that indicates whether non-enumerable 10 properties should be added. 11 12 * API/JSCallbackObject.h: 13 * API/JSCallbackObjectFunctions.h: 14 (JSC::::getOwnPropertyNames): 15 * JavaScriptCore.exp: 16 * JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def: 17 * debugger/DebuggerActivation.cpp: 18 (JSC::DebuggerActivation::getOwnPropertyNames): 19 * debugger/DebuggerActivation.h: 20 * runtime/Arguments.cpp: 21 (JSC::Arguments::getOwnPropertyNames): 22 * runtime/Arguments.h: 23 * runtime/CommonIdentifiers.h: 24 * runtime/JSArray.cpp: 25 (JSC::JSArray::getOwnPropertyNames): 26 * runtime/JSArray.h: 27 * runtime/JSByteArray.cpp: 28 (JSC::JSByteArray::getOwnPropertyNames): 29 * runtime/JSByteArray.h: 30 * runtime/JSFunction.cpp: 31 (JSC::JSFunction::getOwnPropertyNames): 32 * runtime/JSFunction.h: 33 * runtime/JSNotAnObject.cpp: 34 (JSC::JSNotAnObject::getOwnPropertyNames): 35 * runtime/JSNotAnObject.h: 36 * runtime/JSObject.cpp: 37 (JSC::getClassPropertyNames): 38 (JSC::JSObject::getPropertyNames): 39 (JSC::JSObject::getOwnPropertyNames): 40 * runtime/JSObject.h: 41 * runtime/JSVariableObject.cpp: 42 (JSC::JSVariableObject::getOwnPropertyNames): 43 * runtime/JSVariableObject.h: 44 * runtime/ObjectConstructor.cpp: 45 (JSC::ObjectConstructor::ObjectConstructor): 46 (JSC::objectConstructorGetOwnPropertyNames): 47 * runtime/RegExpMatchesArray.h: 48 (JSC::RegExpMatchesArray::getOwnPropertyNames): 49 * runtime/StringObject.cpp: 50 (JSC::StringObject::getOwnPropertyNames): 51 * runtime/StringObject.h: 52 * runtime/Structure.cpp: Rename getEnumerablePropertyNames() to getPropertyNames(), which takes an extra argument. 53 (JSC::Structure::getPropertyNames): 54 * runtime/Structure.h: 55 (JSC::): 56 1 57 2010-01-12 Alexey Proskuryakov <ap@apple.com> 2 58 -
trunk/JavaScriptCore/JavaScriptCore.exp
r52961 r53170 127 127 __ZN3JSC12StringObject18getOwnPropertySlotEPNS_9ExecStateERKNS_10IdentifierERNS_12PropertySlotE 128 128 __ZN3JSC12StringObject18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE 129 __ZN3JSC12StringObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayE 129 __ZN3JSC12StringObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE 130 130 __ZN3JSC12StringObject24getOwnPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE 131 131 __ZN3JSC12StringObject3putEPNS_9ExecStateERKNS_10IdentifierENS_7JSValueERNS_15PutPropertySlotE … … 160 160 __ZN3JSC16JSVariableObject14deletePropertyEPNS_9ExecStateERKNS_10IdentifierE 161 161 __ZN3JSC16JSVariableObject14symbolTableGetERKNS_10IdentifierERNS_18PropertyDescriptorE 162 __ZN3JSC16JSVariableObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayE 162 __ZN3JSC16JSVariableObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE 163 163 __ZN3JSC16toUInt32SlowCaseEdRb 164 164 __ZN3JSC17BytecodeGenerator21setDumpsGeneratedCodeEb … … 254 254 __ZN3JSC8JSObject14deletePropertyEPNS_9ExecStateEj 255 255 __ZN3JSC8JSObject15unwrappedObjectEv 256 __ZN3JSC8JSObject16getPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayE 256 __ZN3JSC8JSObject16getPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE 257 257 __ZN3JSC8JSObject17createInheritorIDEv 258 258 __ZN3JSC8JSObject17defineOwnPropertyEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorEb … … 263 263 __ZN3JSC8JSObject18getOwnPropertySlotEPNS_9ExecStateEjRNS_12PropertySlotE 264 264 __ZN3JSC8JSObject18getPrimitiveNumberEPNS_9ExecStateERdRNS_7JSValueE 265 __ZN3JSC8JSObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayE 265 __ZN3JSC8JSObject19getOwnPropertyNamesEPNS_9ExecStateERNS_17PropertyNameArrayENS_15EnumerationModeE 266 266 __ZN3JSC8JSObject21getPropertyDescriptorEPNS_9ExecStateERKNS_10IdentifierERNS_18PropertyDescriptorE 267 267 __ZN3JSC8JSObject22fillGetterPropertySlotERNS_12PropertySlotEPNS_7JSValueE -
trunk/JavaScriptCore/JavaScriptCore.vcproj/JavaScriptCore/JavaScriptCore.def
r53087 r53170 139 139 ?getOwnPropertyDescriptor@JSString@JSC@@EAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z 140 140 ?getOwnPropertyDescriptor@StringObject@JSC@@UAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z 141 ?getOwnPropertyNames@JSObject@JSC@@UAEXPAVExecState@2@AAVPropertyNameArray@2@ @Z142 ?getOwnPropertyNames@JSVariableObject@JSC@@UAEXPAVExecState@2@AAVPropertyNameArray@2@ @Z143 ?getOwnPropertyNames@StringObject@JSC@@UAEXPAVExecState@2@AAVPropertyNameArray@2@ @Z141 ?getOwnPropertyNames@JSObject@JSC@@UAEXPAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z 142 ?getOwnPropertyNames@JSVariableObject@JSC@@UAEXPAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z 143 ?getOwnPropertyNames@StringObject@JSC@@UAEXPAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z 144 144 ?getOwnPropertySlot@JSCell@JSC@@EAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertySlot@2@@Z 145 145 ?getOwnPropertySlot@JSCell@JSC@@EAE_NPAVExecState@2@IAAVPropertySlot@2@@Z … … 153 153 ?getPrimitiveNumber@JSString@JSC@@EAE_NPAVExecState@2@AANAAVJSValue@2@@Z 154 154 ?getPropertyDescriptor@JSObject@JSC@@QAE_NPAVExecState@2@ABVIdentifier@2@AAVPropertyDescriptor@2@@Z 155 ?getPropertyNames@JSObject@JSC@@UAEXPAVExecState@2@AAVPropertyNameArray@2@ @Z155 ?getPropertyNames@JSObject@JSC@@UAEXPAVExecState@2@AAVPropertyNameArray@2@W4EnumerationMode@2@@Z 156 156 ?getSlice@ArgList@JSC@@QBEXHAAV12@@Z 157 157 ?getString@JSCell@JSC@@QBE?AVUString@2@PAVExecState@2@@Z -
trunk/JavaScriptCore/debugger/DebuggerActivation.cpp
r51971 r53170 72 72 } 73 73 74 void DebuggerActivation::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames )74 void DebuggerActivation::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 75 75 { 76 m_activation->getPropertyNames(exec, propertyNames );76 m_activation->getPropertyNames(exec, propertyNames, mode); 77 77 } 78 78 -
trunk/JavaScriptCore/debugger/DebuggerActivation.h
r51971 r53170 43 43 virtual void putWithAttributes(ExecState*, const Identifier& propertyName, JSValue, unsigned attributes); 44 44 virtual bool deleteProperty(ExecState*, const Identifier& propertyName); 45 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray& );45 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); 46 46 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 47 47 virtual void defineGetter(ExecState*, const Identifier& propertyName, JSObject* getterFunction, unsigned attributes); -
trunk/JavaScriptCore/runtime/Arguments.cpp
r47780 r53170 205 205 } 206 206 207 void Arguments::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 208 { 209 if (mode == IncludeDontEnumProperties) { 210 for (unsigned i = 0; i < d->numArguments; ++i) { 211 if (!d->deletedArguments || !d->deletedArguments[i]) 212 propertyNames.add(Identifier(exec, UString::from(i))); 213 } 214 propertyNames.add(exec->propertyNames().callee); 215 propertyNames.add(exec->propertyNames().length); 216 } 217 JSObject::getOwnPropertyNames(exec, propertyNames, mode); 218 } 219 207 220 void Arguments::put(ExecState* exec, unsigned i, JSValue value, PutPropertySlot& slot) 208 221 { -
trunk/JavaScriptCore/runtime/Arguments.h
r49721 r53170 97 97 virtual bool getOwnPropertySlot(ExecState*, unsigned propertyName, PropertySlot&); 98 98 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 99 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); 99 100 virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); 100 101 virtual void put(ExecState*, unsigned propertyName, JSValue, PutPropertySlot&); -
trunk/JavaScriptCore/runtime/CommonIdentifiers.h
r48568 r53170 51 51 macro(getPrototypeOf) \ 52 52 macro(getOwnPropertyDescriptor) \ 53 macro(getOwnPropertyNames) \ 53 54 macro(hasOwnProperty) \ 54 55 macro(ignoreCase) \ -
trunk/JavaScriptCore/runtime/JSArray.cpp
r53091 r53170 470 470 } 471 471 472 void JSArray::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames )472 void JSArray::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 473 473 { 474 474 // FIXME: Filling PropertyNameArray with an identifier for every integer … … 490 490 } 491 491 492 JSObject::getOwnPropertyNames(exec, propertyNames); 492 if (mode == IncludeDontEnumProperties) 493 propertyNames.add(exec->propertyNames().length); 494 495 JSObject::getOwnPropertyNames(exec, propertyNames, mode); 493 496 } 494 497 -
trunk/JavaScriptCore/runtime/JSArray.h
r53025 r53170 99 99 virtual bool deleteProperty(ExecState*, const Identifier& propertyName); 100 100 virtual bool deleteProperty(ExecState*, unsigned propertyName); 101 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray& );101 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); 102 102 virtual void markChildren(MarkStack&); 103 103 -
trunk/JavaScriptCore/runtime/JSByteArray.cpp
r52956 r53170 105 105 } 106 106 107 void JSByteArray::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames )107 void JSByteArray::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 108 108 { 109 109 unsigned length = m_storage->length(); 110 110 for (unsigned i = 0; i < length; ++i) 111 111 propertyNames.add(Identifier::from(exec, i)); 112 JSObject::getOwnPropertyNames(exec, propertyNames );112 JSObject::getOwnPropertyNames(exec, propertyNames, mode); 113 113 } 114 114 -
trunk/JavaScriptCore/runtime/JSByteArray.h
r52956 r53170 83 83 virtual void put(JSC::ExecState*, unsigned propertyName, JSC::JSValue); 84 84 85 virtual void getOwnPropertyNames(JSC::ExecState*, JSC::PropertyNameArray& );85 virtual void getOwnPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); 86 86 87 87 virtual const ClassInfo* classInfo() const { return m_classInfo; } -
trunk/JavaScriptCore/runtime/JSFunction.cpp
r52956 r53170 209 209 } 210 210 211 void JSFunction::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 212 { 213 if (!isHostFunction() && (mode == IncludeDontEnumProperties)) { 214 propertyNames.add(exec->propertyNames().arguments); 215 propertyNames.add(exec->propertyNames().callee); 216 propertyNames.add(exec->propertyNames().caller); 217 propertyNames.add(exec->propertyNames().length); 218 } 219 Base::getOwnPropertyNames(exec, propertyNames, mode); 220 } 221 211 222 void JSFunction::put(ExecState* exec, const Identifier& propertyName, JSValue value, PutPropertySlot& slot) 212 223 { -
trunk/JavaScriptCore/runtime/JSFunction.h
r52956 r53170 83 83 virtual bool getOwnPropertySlot(ExecState*, const Identifier&, PropertySlot&); 84 84 virtual bool getOwnPropertyDescriptor(ExecState*, const Identifier&, PropertyDescriptor&); 85 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); 85 86 virtual void put(ExecState*, const Identifier& propertyName, JSValue, PutPropertySlot&); 86 87 virtual bool deleteProperty(ExecState*, const Identifier& propertyName); -
trunk/JavaScriptCore/runtime/JSNotAnObject.cpp
r48336 r53170 122 122 } 123 123 124 void JSNotAnObject::getOwnPropertyNames(ExecState* exec, PropertyNameArray& )124 void JSNotAnObject::getOwnPropertyNames(ExecState* exec, PropertyNameArray&, EnumerationMode) 125 125 { 126 126 ASSERT_UNUSED(exec, exec->hadException() && exec->exception() == m_exception); -
trunk/JavaScriptCore/runtime/JSNotAnObject.h
r49721 r53170 92 92 virtual bool deleteProperty(ExecState*, unsigned propertyName); 93 93 94 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray& );94 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); 95 95 96 96 JSNotAnObjectErrorStub* m_exception; -
trunk/JavaScriptCore/runtime/JSObject.cpp
r51971 r53170 43 43 ASSERT_CLASS_FITS_IN_CELL(JSObject); 44 44 45 static inline void get EnumerablePropertyNames(ExecState* exec, const ClassInfo* classInfo, PropertyNameArray& propertyNames)45 static inline void getClassPropertyNames(ExecState* exec, const ClassInfo* classInfo, PropertyNameArray& propertyNames, EnumerationMode mode) 46 46 { 47 47 // Add properties from the static hashtables of properties … … 56 56 const HashEntry* entry = table->table; 57 57 for (int i = 0; i <= hashSizeMask; ++i, ++entry) { 58 if (entry->key() && !(entry->attributes() & DontEnum))58 if (entry->key() && (!(entry->attributes() & DontEnum) || (mode == IncludeDontEnumProperties))) 59 59 propertyNames.add(entry->key()); 60 60 } … … 426 426 } 427 427 428 void JSObject::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames )429 { 430 getOwnPropertyNames(exec, propertyNames );428 void JSObject::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 429 { 430 getOwnPropertyNames(exec, propertyNames, mode); 431 431 432 432 if (prototype().isNull()) … … 436 436 while(1) { 437 437 if (prototype->structure()->typeInfo().overridesGetPropertyNames()) { 438 prototype->getPropertyNames(exec, propertyNames );438 prototype->getPropertyNames(exec, propertyNames, mode); 439 439 break; 440 440 } 441 prototype->getOwnPropertyNames(exec, propertyNames );441 prototype->getOwnPropertyNames(exec, propertyNames, mode); 442 442 JSValue nextProto = prototype->prototype(); 443 443 if (nextProto.isNull()) … … 447 447 } 448 448 449 void JSObject::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames )450 { 451 m_structure->get EnumerablePropertyNames(propertyNames);452 get EnumerablePropertyNames(exec, classInfo(), propertyNames);449 void JSObject::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 450 { 451 m_structure->getPropertyNames(propertyNames, mode); 452 getClassPropertyNames(exec, classInfo(), propertyNames, mode); 453 453 } 454 454 -
trunk/JavaScriptCore/runtime/JSObject.h
r51971 r53170 123 123 virtual bool hasInstance(ExecState*, JSValue, JSValue prototypeProperty); 124 124 125 virtual void getPropertyNames(ExecState*, PropertyNameArray& );126 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray& );125 virtual void getPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); 126 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); 127 127 128 128 virtual JSValue toPrimitive(ExecState*, PreferredPrimitiveType = NoPreference) const; -
trunk/JavaScriptCore/runtime/JSVariableObject.cpp
r51971 r53170 43 43 } 44 44 45 void JSVariableObject::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames )45 void JSVariableObject::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 46 46 { 47 47 SymbolTable::const_iterator end = symbolTable().end(); 48 48 for (SymbolTable::const_iterator it = symbolTable().begin(); it != end; ++it) { 49 if (!(it->second.getAttributes() & DontEnum) )49 if (!(it->second.getAttributes() & DontEnum) || (mode == IncludeDontEnumProperties)) 50 50 propertyNames.add(Identifier(exec, it->first.get())); 51 51 } 52 52 53 JSObject::getOwnPropertyNames(exec, propertyNames );53 JSObject::getOwnPropertyNames(exec, propertyNames, mode); 54 54 } 55 55 -
trunk/JavaScriptCore/runtime/JSVariableObject.h
r51971 r53170 50 50 51 51 virtual bool deleteProperty(ExecState*, const Identifier&); 52 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray& );52 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); 53 53 54 54 virtual bool isVariableObject() const; -
trunk/JavaScriptCore/runtime/ObjectConstructor.cpp
r51760 r53170 37 37 static JSValue JSC_HOST_CALL objectConstructorGetPrototypeOf(ExecState*, JSObject*, JSValue, const ArgList&); 38 38 static JSValue JSC_HOST_CALL objectConstructorGetOwnPropertyDescriptor(ExecState*, JSObject*, JSValue, const ArgList&); 39 static JSValue JSC_HOST_CALL objectConstructorGetOwnPropertyNames(ExecState*, JSObject*, JSValue, const ArgList&); 39 40 static JSValue JSC_HOST_CALL objectConstructorKeys(ExecState*, JSObject*, JSValue, const ArgList&); 40 41 static JSValue JSC_HOST_CALL objectConstructorDefineProperty(ExecState*, JSObject*, JSValue, const ArgList&); … … 53 54 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().getPrototypeOf, objectConstructorGetPrototypeOf), DontEnum); 54 55 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 2, exec->propertyNames().getOwnPropertyDescriptor, objectConstructorGetOwnPropertyDescriptor), DontEnum); 56 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().getOwnPropertyNames, objectConstructorGetOwnPropertyNames), DontEnum); 55 57 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 1, exec->propertyNames().keys, objectConstructorKeys), DontEnum); 56 58 putDirectFunctionWithoutTransition(exec, new (exec) NativeFunctionWrapper(exec, prototypeFunctionStructure, 3, exec->propertyNames().defineProperty, objectConstructorDefineProperty), DontEnum); … … 124 126 125 127 return description; 128 } 129 130 // FIXME: Use the enumeration cache. 131 JSValue JSC_HOST_CALL objectConstructorGetOwnPropertyNames(ExecState* exec, JSObject*, JSValue, const ArgList& args) 132 { 133 if (!args.at(0).isObject()) 134 return throwError(exec, TypeError, "Requested property names of a value that is not an object."); 135 PropertyNameArray properties(exec); 136 asObject(args.at(0))->getOwnPropertyNames(exec, properties, IncludeDontEnumProperties); 137 JSArray* names = constructEmptyArray(exec); 138 size_t numProperties = properties.size(); 139 for (size_t i = 0; i < numProperties; i++) 140 names->push(exec, jsOwnedString(exec, properties[i].ustring())); 141 return names; 126 142 } 127 143 -
trunk/JavaScriptCore/runtime/RegExpMatchesArray.h
r48336 r53170 80 80 } 81 81 82 virtual void getOwnPropertyNames(ExecState* exec, PropertyNameArray& arr )82 virtual void getOwnPropertyNames(ExecState* exec, PropertyNameArray& arr, EnumerationMode mode = ExcludeDontEnumProperties) 83 83 { 84 84 if (lazyCreationData()) 85 85 fillArrayInstance(exec); 86 JSArray::getOwnPropertyNames(exec, arr );86 JSArray::getOwnPropertyNames(exec, arr, mode); 87 87 } 88 88 -
trunk/JavaScriptCore/runtime/StringObject.cpp
r51724 r53170 87 87 } 88 88 89 void StringObject::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames )89 void StringObject::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 90 90 { 91 91 int size = internalValue()->length(); 92 92 for (int i = 0; i < size; ++i) 93 93 propertyNames.add(Identifier(exec, UString::from(i))); 94 return JSObject::getOwnPropertyNames(exec, propertyNames); 94 if (mode == IncludeDontEnumProperties) 95 propertyNames.add(exec->propertyNames().length); 96 return JSObject::getOwnPropertyNames(exec, propertyNames, mode); 95 97 } 96 98 -
trunk/JavaScriptCore/runtime/StringObject.h
r49721 r53170 40 40 virtual void put(ExecState* exec, const Identifier& propertyName, JSValue, PutPropertySlot&); 41 41 virtual bool deleteProperty(ExecState*, const Identifier& propertyName); 42 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray& );42 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); 43 43 44 44 virtual const ClassInfo* classInfo() const { return &info; } -
trunk/JavaScriptCore/runtime/Structure.cpp
r52948 r53170 1075 1075 } 1076 1076 1077 void Structure::get EnumerablePropertyNames(PropertyNameArray& propertyNames)1077 void Structure::getPropertyNames(PropertyNameArray& propertyNames, EnumerationMode mode) 1078 1078 { 1079 1079 materializePropertyMapIfNecessary(); … … 1087 1087 for (unsigned k = 1; k <= entryCount; k++) { 1088 1088 ASSERT(m_hasNonEnumerableProperties || !(m_propertyTable->entries()[k].attributes & DontEnum)); 1089 if (m_propertyTable->entries()[k].key && !(m_propertyTable->entries()[k].attributes & DontEnum)) {1089 if (m_propertyTable->entries()[k].key && (!(m_propertyTable->entries()[k].attributes & DontEnum) || (mode == IncludeDontEnumProperties))) { 1090 1090 PropertyMapEntry* value = &m_propertyTable->entries()[k]; 1091 1091 int j; … … 1114 1114 unsigned entryCount = m_propertyTable->keyCount + m_propertyTable->deletedSentinelCount; 1115 1115 for (unsigned i = 1; i <= entryCount; i++) { 1116 if (m_propertyTable->entries()[i].key && !(m_propertyTable->entries()[i].attributes & DontEnum))1116 if (m_propertyTable->entries()[i].key && (!(m_propertyTable->entries()[i].attributes & DontEnum) || (mode == IncludeDontEnumProperties))) 1117 1117 *p++ = &m_propertyTable->entries()[i]; 1118 1118 } -
trunk/JavaScriptCore/runtime/Structure.h
r52948 r53170 52 52 class PropertyNameArrayData; 53 53 54 enum EnumerationMode { 55 ExcludeDontEnumProperties, 56 IncludeDontEnumProperties 57 }; 58 54 59 class Structure : public RefCounted<Structure> { 55 60 public: … … 132 137 void setEnumerationCache(JSPropertyNameIterator* enumerationCache); // Defined in JSPropertyNameIterator.h. 133 138 JSPropertyNameIterator* enumerationCache() { return m_enumerationCache.get(); } 134 void get EnumerablePropertyNames(PropertyNameArray&);139 void getPropertyNames(PropertyNameArray&, EnumerationMode mode); 135 140 136 141 private: -
trunk/JavaScriptGlue/ChangeLog
r52959 r53170 1 2010-01-12 Kent Hansen <kent.hansen@nokia.com> 2 3 Reviewed by Geoffrey Garen. 4 5 [ES5] Implement Object.getOwnPropertyNames 6 https://bugs.webkit.org/show_bug.cgi?id=32242 7 8 Add new argument to the reimplementation of getOwnPropertyNames(). 9 10 * UserObjectImp.cpp: 11 (UserObjectImp::getOwnPropertyNames): 12 * UserObjectImp.h: 13 1 14 2010-01-07 Alexey Proskuryakov <ap@apple.com> 2 15 -
trunk/JavaScriptGlue/UserObjectImp.cpp
r52856 r53170 95 95 96 96 97 void UserObjectImp::getOwnPropertyNames(ExecState *exec, PropertyNameArray& propertyNames )97 void UserObjectImp::getOwnPropertyNames(ExecState *exec, PropertyNameArray& propertyNames, EnumerationMode mode) 98 98 { 99 99 JSUserObject* ptr = GetJSUserObject(); … … 110 110 } 111 111 } 112 JSObject::getOwnPropertyNames(exec, propertyNames );112 JSObject::getOwnPropertyNames(exec, propertyNames, mode); 113 113 } 114 114 -
trunk/JavaScriptGlue/UserObjectImp.h
r49694 r53170 45 45 virtual CallType getCallData(CallData&); 46 46 47 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray& );47 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); 48 48 49 49 virtual JSValue callAsFunction(ExecState *exec, JSObject *thisObj, const ArgList &args); -
trunk/LayoutTests/ChangeLog
r53169 r53170 1 2010-01-12 Kent Hansen <kent.hansen@nokia.com> 2 3 Reviewed by Geoffrey Garen. 4 5 [ES5] Implement Object.getOwnPropertyNames 6 https://bugs.webkit.org/show_bug.cgi?id=32242 7 8 Add tests for Object.getOwnPropertyNames(o), both standard usage and cross origin. 9 10 * fast/js/Object-getOwnPropertyNames-expected.txt: Added. 11 * fast/js/Object-getOwnPropertyNames.html: Added. 12 * fast/js/script-tests/Object-getOwnPropertyNames.js: Added. 13 * http/tests/security/cross-frame-access-enumeration-expected.txt: 14 * http/tests/security/cross-frame-access-enumeration.html: 15 1 16 2010-01-12 Brian Weinstein <bweinstein@apple.com> 2 17 -
trunk/LayoutTests/http/tests/security/cross-frame-access-enumeration-expected.txt
r51644 r53170 1 CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe-for-enumeration-test.html from frame with URL http://127.0.0.1:8000/security/cross-frame-access-enumeration.html. Domains, protocols and ports must match. 2 3 CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe-for-enumeration-test.html from frame with URL http://127.0.0.1:8000/security/cross-frame-access-enumeration.html. Domains, protocols and ports must match. 4 5 CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe-for-enumeration-test.html from frame with URL http://127.0.0.1:8000/security/cross-frame-access-enumeration.html. Domains, protocols and ports must match. 6 1 7 CONSOLE MESSAGE: line 1: Unsafe JavaScript attempt to access frame with URL http://localhost:8000/security/resources/cross-frame-iframe-for-enumeration-test.html from frame with URL http://127.0.0.1:8000/security/cross-frame-access-enumeration.html. Domains, protocols and ports must match. 2 8 … … 20 26 PASS: Cross frame access by enumerating the window object was denied. 21 27 PASS: Cross frame access by getting the keys of the window object was denied. 28 PASS: Cross frame access by getting the property names of the window object was denied. 22 29 PASS: Cross frame access by enumerating the History object was denied. 23 30 PASS: Cross frame access by getting the keys of the History object was denied. 31 PASS: Cross frame access by getting the property names of the History object was denied. 24 32 PASS: Cross frame access by enumerating the Location object was denied. 25 33 PASS: Cross frame access by getting the keys of the Location object was denied. 34 PASS: Cross frame access by getting the property names of the Location object was denied. 26 35 -
trunk/LayoutTests/http/tests/security/cross-frame-access-enumeration.html
r48336 r53170 53 53 log("PASS: Cross frame access by getting the keys of the window object was denied."); 54 54 55 var b_winPropertyNames = Object.getOwnPropertyNames(b_win); 56 if (b_winPropertyNames.indexOf("customWindowProperty") != -1) { 57 log("FAIL: Cross frame access by getting the property names of the window object was allowed."); 58 return; 59 } 60 log("PASS: Cross frame access by getting the property names of the window object was denied."); 61 55 62 // Test enumerating the History object 56 63 var b_win_history = b_win.history; … … 73 80 log("PASS: Cross frame access by getting the keys of the History object was denied."); 74 81 82 var b_winHistoryPropertyNames = Object.getOwnPropertyNames(b_win_history); 83 if (b_winHistoryPropertyNames.indexOf("customHistoryProperty") != -1) { 84 log("FAIL: Cross frame access by getting the property names of the History object was allowed."); 85 return; 86 } 87 log("PASS: Cross frame access by getting the property names of the History object was denied."); 88 75 89 // Test enumerating the Location object 76 90 var b_win_location = b_win.location; … … 92 106 } 93 107 log("PASS: Cross frame access by getting the keys of the Location object was denied."); 108 109 var b_winLocationPropertyNames = Object.getOwnPropertyNames(b_win_location); 110 if (b_winLocationPropertyNames.indexOf("customLocationProperty") != -1) { 111 log("FAIL: Cross frame access by getting the property names of the Location object was allowed."); 112 return; 113 } 114 log("PASS: Cross frame access by getting the property names of the Location object was denied."); 94 115 } 95 116 </script> -
trunk/WebCore/ChangeLog
r53168 r53170 1 2010-01-12 Kent Hansen <kent.hansen@nokia.com> 2 3 Reviewed by Geoffrey Garen. 4 5 [ES5] Implement Object.getOwnPropertyNames 6 https://bugs.webkit.org/show_bug.cgi?id=32242 7 8 Add new argument to reimplementations of getPropertyNames() 9 and getOwnPropertyNames(), and update the JS bindings generator. 10 11 Test: fast/js/Object-getOwnPropertyNames.html 12 13 * bindings/js/JSDOMWindowCustom.cpp: 14 (WebCore::JSDOMWindow::getPropertyNames): 15 (WebCore::JSDOMWindow::getOwnPropertyNames): 16 * bindings/js/JSDOMWindowShell.cpp: 17 (WebCore::JSDOMWindowShell::getPropertyNames): 18 (WebCore::JSDOMWindowShell::getOwnPropertyNames): 19 * bindings/js/JSDOMWindowShell.h: 20 * bindings/js/JSHistoryCustom.cpp: 21 (WebCore::JSHistory::getOwnPropertyNames): 22 * bindings/js/JSLocationCustom.cpp: 23 (WebCore::JSLocation::getOwnPropertyNames): 24 * bindings/js/JSQuarantinedObjectWrapper.cpp: 25 (WebCore::JSQuarantinedObjectWrapper::getPropertyNames): 26 (WebCore::JSQuarantinedObjectWrapper::getOwnPropertyNames): 27 * bindings/js/JSQuarantinedObjectWrapper.h: 28 * bindings/js/JSStorageCustom.cpp: 29 (WebCore::JSStorage::getOwnPropertyNames): 30 * bindings/scripts/CodeGeneratorJS.pm: 31 * bridge/runtime_array.cpp: 32 (JSC::RuntimeArray::getOwnPropertyNames): 33 * bridge/runtime_array.h: 34 * bridge/runtime_object.cpp: 35 (JSC::RuntimeObjectImp::getPropertyNames): 36 (JSC::RuntimeObjectImp::getOwnPropertyNames): 37 * bridge/runtime_object.h: 38 1 39 2010-01-12 Brian Weinstein <bweinstein@apple.com> 2 40 -
trunk/WebCore/bindings/js/JSDOMWindowCustom.cpp
r52314 r53170 420 420 } 421 421 422 void JSDOMWindow::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames )422 void JSDOMWindow::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 423 423 { 424 424 // Only allow the window to enumerated by frames in the same origin. 425 425 if (!allowsAccessFrom(exec)) 426 426 return; 427 Base::getPropertyNames(exec, propertyNames );428 } 429 430 void JSDOMWindow::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames )427 Base::getPropertyNames(exec, propertyNames, mode); 428 } 429 430 void JSDOMWindow::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 431 431 { 432 432 // Only allow the window to enumerated by frames in the same origin. 433 433 if (!allowsAccessFrom(exec)) 434 434 return; 435 Base::getOwnPropertyNames(exec, propertyNames );435 Base::getOwnPropertyNames(exec, propertyNames, mode); 436 436 } 437 437 -
trunk/WebCore/bindings/js/JSDOMWindowShell.cpp
r51971 r53170 115 115 } 116 116 117 void JSDOMWindowShell::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames )117 void JSDOMWindowShell::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 118 118 { 119 m_window->getPropertyNames(exec, propertyNames );119 m_window->getPropertyNames(exec, propertyNames, mode); 120 120 } 121 121 122 void JSDOMWindowShell::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames )122 void JSDOMWindowShell::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 123 123 { 124 m_window->getOwnPropertyNames(exec, propertyNames );124 m_window->getOwnPropertyNames(exec, propertyNames, mode); 125 125 } 126 126 -
trunk/WebCore/bindings/js/JSDOMWindowShell.h
r51971 r53170 76 76 virtual void putWithAttributes(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSValue, unsigned attributes); 77 77 virtual bool deleteProperty(JSC::ExecState*, const JSC::Identifier& propertyName); 78 virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray& );79 virtual void getOwnPropertyNames(JSC::ExecState*, JSC::PropertyNameArray& );78 virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties); 79 virtual void getOwnPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties); 80 80 virtual void defineGetter(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSObject* getterFunction, unsigned attributes); 81 81 virtual void defineSetter(JSC::ExecState*, const JSC::Identifier& propertyName, JSC::JSObject* setterFunction, unsigned attributes); -
trunk/WebCore/bindings/js/JSHistoryCustom.cpp
r51757 r53170 155 155 } 156 156 157 void JSHistory::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames )157 void JSHistory::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 158 158 { 159 159 // Only allow the history object to enumerated by frames in the same origin. 160 160 if (!allowsAccessFromFrame(exec, impl()->frame())) 161 161 return; 162 Base::getOwnPropertyNames(exec, propertyNames );162 Base::getOwnPropertyNames(exec, propertyNames, mode); 163 163 } 164 164 -
trunk/WebCore/bindings/js/JSLocationCustom.cpp
r51757 r53170 169 169 } 170 170 171 void JSLocation::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames )171 void JSLocation::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 172 172 { 173 173 // Only allow the location object to enumerated by frames in the same origin. 174 174 if (!allowsAccessFromFrame(exec, impl()->frame())) 175 175 return; 176 Base::getOwnPropertyNames(exec, propertyNames );176 Base::getOwnPropertyNames(exec, propertyNames, mode); 177 177 } 178 178 -
trunk/WebCore/bindings/js/JSQuarantinedObjectWrapper.cpp
r51512 r53170 314 314 } 315 315 316 void JSQuarantinedObjectWrapper::getPropertyNames(ExecState*, PropertyNameArray& array )316 void JSQuarantinedObjectWrapper::getPropertyNames(ExecState*, PropertyNameArray& array, EnumerationMode mode) 317 317 { 318 318 if (!allowsGetPropertyNames()) 319 319 return; 320 320 321 m_unwrappedObject->getPropertyNames(unwrappedExecState(), array );322 } 323 324 void JSQuarantinedObjectWrapper::getOwnPropertyNames(ExecState*, PropertyNameArray& array )321 m_unwrappedObject->getPropertyNames(unwrappedExecState(), array, mode); 322 } 323 324 void JSQuarantinedObjectWrapper::getOwnPropertyNames(ExecState*, PropertyNameArray& array, EnumerationMode mode) 325 325 { 326 326 if (!allowsGetPropertyNames()) 327 327 return; 328 328 329 m_unwrappedObject->getOwnPropertyNames(unwrappedExecState(), array );329 m_unwrappedObject->getOwnPropertyNames(unwrappedExecState(), array, mode); 330 330 } 331 331 -
trunk/WebCore/bindings/js/JSQuarantinedObjectWrapper.h
r49835 r53170 75 75 virtual bool hasInstance(JSC::ExecState*, JSC::JSValue, JSC::JSValue proto); 76 76 77 virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray& );78 virtual void getOwnPropertyNames(JSC::ExecState*, JSC::PropertyNameArray& );77 virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties); 78 virtual void getOwnPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties); 79 79 80 80 virtual JSC::UString className() const { return m_unwrappedObject->className(); } -
trunk/WebCore/bindings/js/JSStorageCustom.cpp
r48336 r53170 65 65 } 66 66 67 void JSStorage::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames )67 void JSStorage::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 68 68 { 69 69 unsigned length = m_impl->length(); … … 71 71 propertyNames.add(Identifier(exec, m_impl->key(i))); 72 72 73 Base::getOwnPropertyNames(exec, propertyNames );73 Base::getOwnPropertyNames(exec, propertyNames, mode); 74 74 } 75 75 -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r53086 r53170 648 648 # Custom getPropertyNames function exists on DOMWindow 649 649 if ($interfaceName eq "DOMWindow") { 650 push(@headerContent, " virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray& );\n");650 push(@headerContent, " virtual void getPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties);\n"); 651 651 $structureFlags{"JSC::OverridesGetPropertyNames"} = 1; 652 652 } … … 657 657 # Custom getOwnPropertyNames function 658 658 if ($dataNode->extendedAttributes->{"CustomGetPropertyNames"} || $dataNode->extendedAttributes->{"HasIndexGetter"} || $dataNode->extendedAttributes->{"HasCustomIndexGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}) { 659 push(@headerContent, " virtual void getOwnPropertyNames(JSC::ExecState*, JSC::PropertyNameArray& );\n");659 push(@headerContent, " virtual void getOwnPropertyNames(JSC::ExecState*, JSC::PropertyNameArray&, JSC::EnumerationMode mode = JSC::ExcludeDontEnumProperties);\n"); 660 660 $structureFlags{"JSC::OverridesGetPropertyNames"} = 1; 661 661 } … … 1539 1539 1540 1540 if (($dataNode->extendedAttributes->{"HasIndexGetter"} || $dataNode->extendedAttributes->{"HasCustomIndexGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}) && !$dataNode->extendedAttributes->{"CustomGetPropertyNames"}) { 1541 push(@implContent, "void ${className}::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames )\n");1541 push(@implContent, "void ${className}::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode)\n"); 1542 1542 push(@implContent, "{\n"); 1543 1543 if ($dataNode->extendedAttributes->{"HasIndexGetter"} || $dataNode->extendedAttributes->{"HasCustomIndexGetter"} || $dataNode->extendedAttributes->{"HasNumericIndexGetter"}) { … … 1545 1545 push(@implContent, " propertyNames.add(Identifier::from(exec, i));\n"); 1546 1546 } 1547 push(@implContent, " Base::getOwnPropertyNames(exec, propertyNames );\n");1547 push(@implContent, " Base::getOwnPropertyNames(exec, propertyNames, mode);\n"); 1548 1548 push(@implContent, "}\n\n"); 1549 1549 } -
trunk/WebCore/bridge/runtime_array.cpp
r51985 r53170 58 58 } 59 59 60 void RuntimeArray::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames )60 void RuntimeArray::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 61 61 { 62 62 unsigned length = getLength(); … … 64 64 propertyNames.add(Identifier::from(exec, i)); 65 65 66 JSObject::getOwnPropertyNames(exec, propertyNames); 66 if (mode == IncludeDontEnumProperties) 67 propertyNames.add(exec->propertyNames().length); 68 69 JSObject::getOwnPropertyNames(exec, propertyNames, mode); 67 70 } 68 71 -
trunk/WebCore/bridge/runtime_array.h
r51985 r53170 36 36 RuntimeArray(ExecState*, Bindings::Array*); 37 37 38 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray& );38 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); 39 39 virtual bool getOwnPropertySlot(ExecState *, const Identifier&, PropertySlot&); 40 40 virtual bool getOwnPropertySlot(ExecState *, unsigned, PropertySlot&); -
trunk/WebCore/bridge/runtime_object.cpp
r48836 r53170 303 303 } 304 304 305 void RuntimeObjectImp::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames )305 void RuntimeObjectImp::getPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode) 306 306 { 307 307 if (!m_instance) { … … 317 317 } 318 318 319 void RuntimeObjectImp::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames )320 { 321 getOwnPropertyNames(exec, propertyNames );319 void RuntimeObjectImp::getOwnPropertyNames(ExecState* exec, PropertyNameArray& propertyNames, EnumerationMode mode) 320 { 321 getOwnPropertyNames(exec, propertyNames, mode); 322 322 } 323 323 -
trunk/WebCore/bridge/runtime_object.h
r49835 r53170 45 45 virtual ConstructType getConstructData(ConstructData&); 46 46 47 virtual void getPropertyNames(ExecState*, PropertyNameArray& );48 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray& );47 virtual void getPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); 48 virtual void getOwnPropertyNames(ExecState*, PropertyNameArray&, EnumerationMode mode = ExcludeDontEnumProperties); 49 49 50 50 void invalidate();
Note: See TracChangeset
for help on using the changeset viewer.