Clean up EnumerationMode to easily extend
https://bugs.webkit.org/show_bug.cgi?id=143276
Reviewed by Geoffrey Garen.
Source/JavaScriptCore:
To make the followings easily,
- Adding new flag Include/ExcludeSymbols in the Object.getOwnPropertySymbols patch
- Make ExcludeSymbols implicitly default for the existing flags
we encapsulate EnumerationMode flags into EnumerationMode class.
And this class manages 2 flags. Later it will be extended to 3.
- DontEnumPropertiesMode (default is Exclude)
- JSObjectPropertiesMode (default is Include)
- SymbolPropertiesMode (default is Exclude)
SymbolPropertiesMode will be added in Object.getOwnPropertySymbols patch.
This patch replaces places using ExcludeDontEnumProperties
to EnumerationMode() value which represents default mode.
- API/JSCallbackObjectFunctions.h:
(JSC::JSCallbackObject<Parent>::getOwnNonIndexPropertyNames):
(JSObjectCopyPropertyNames):
- bindings/ScriptValue.cpp:
(Deprecated::jsToInspectorValue):
- bytecode/ObjectAllocationProfile.h:
(JSC::ObjectAllocationProfile::possibleDefaultPropertyCount):
- runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncSort):
- runtime/EnumerationMode.h:
(JSC::EnumerationMode::EnumerationMode):
(JSC::EnumerationMode::includeDontEnumProperties):
(JSC::EnumerationMode::includeJSObjectProperties):
(JSC::shouldIncludeDontEnumProperties): Deleted.
(JSC::shouldExcludeDontEnumProperties): Deleted.
(JSC::shouldIncludeJSObjectPropertyNames): Deleted.
(JSC::modeThatSkipsJSObject): Deleted.
- runtime/GenericArgumentsInlines.h:
(JSC::GenericArguments<Type>::getOwnPropertyNames):
(JSC::JSArray::getOwnNonIndexPropertyNames):
- runtime/JSArrayBuffer.cpp:
(JSC::JSArrayBuffer::getOwnNonIndexPropertyNames):
- runtime/JSArrayBufferView.cpp:
(JSC::JSArrayBufferView::getOwnNonIndexPropertyNames):
(JSC::JSFunction::getOwnNonIndexPropertyNames):
- runtime/JSFunction.h:
- runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::getOwnNonIndexPropertyNames):
- runtime/JSLexicalEnvironment.cpp:
(JSC::JSLexicalEnvironment::getOwnNonIndexPropertyNames):
(JSC::Stringifier::Holder::appendNextProperty):
(JSC::Walker::walk):
(JSC::getClassPropertyNames):
(JSC::JSObject::getOwnPropertyNames):
(JSC::JSObject::getOwnNonIndexPropertyNames):
(JSC::JSObject::getGenericPropertyNames):
- runtime/JSPropertyNameEnumerator.h:
(JSC::propertyNameEnumerator):
- runtime/JSSymbolTableObject.cpp:
(JSC::JSSymbolTableObject::getOwnNonIndexPropertyNames):
- runtime/ObjectConstructor.cpp:
(JSC::objectConstructorGetOwnPropertyNames):
(JSC::objectConstructorKeys):
(JSC::defineProperties):
(JSC::objectConstructorSeal):
(JSC::objectConstructorFreeze):
(JSC::objectConstructorIsSealed):
(JSC::objectConstructorIsFrozen):
- runtime/RegExpObject.cpp:
(JSC::RegExpObject::getOwnNonIndexPropertyNames):
(JSC::RegExpObject::getPropertyNames):
(JSC::RegExpObject::getGenericPropertyNames):
- runtime/StringObject.cpp:
(JSC::StringObject::getOwnPropertyNames):
(JSC::Structure::getPropertyNamesFromStructure):
Source/WebCore:
Use default EnumerationMode().
- bindings/js/Dictionary.cpp:
(WebCore::Dictionary::getOwnPropertiesAsStringHashMap):
(WebCore::Dictionary::getOwnPropertyNames):
- bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::serialize):
- bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
- bindings/scripts/test/JS/JSFloat64Array.h:
- bindings/scripts/test/JS/JSTestEventTarget.h:
- bridge/NP_jsobject.cpp:
(_NPN_Enumerate):
- bridge/runtime_array.cpp:
(JSC::RuntimeArray::getOwnPropertyNames):
Source/WebKit/mac:
Use default EnumerationMode().
- Plugins/Hosted/NetscapePluginInstanceProxy.mm:
(WebKit::NetscapePluginInstanceProxy::enumerate):
Source/WebKit2:
Use default EnumerationMode().
- WebProcess/Plugins/Netscape/NPJSObject.cpp:
(WebKit::NPJSObject::enumerate):