TextPosition and OrdinalNumber should be more like idiomatic numbers
https://bugs.webkit.org/show_bug.cgi?id=165678
Reviewed by Filip Pizlo.
Source/JavaScriptCore:
Adopt default constructor.
(JSEvaluateScript):
(JSCheckScriptSyntax):
(JSObjectMakeFunction):
(OpaqueJSScript::OpaqueJSScript):
(functionCheckModuleSyntax):
(JSC::makeSource):
(JSC::StringSourceProvider::create):
(JSC::WebAssemblySourceProvider::WebAssemblySourceProvider):
- runtime/FunctionConstructor.cpp:
(JSC::constructFunction):
- runtime/ModuleLoaderPrototype.cpp:
(JSC::moduleLoaderPrototypeParseModule):
Source/WebCore:
- bindings/js/CachedScriptSourceProvider.h:
(WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider):
- bindings/js/JSEventListener.h:
(WebCore::JSEventListener::sourcePosition):
- bindings/js/JSLazyEventListener.cpp:
(WebCore::JSLazyEventListener::JSLazyEventListener):
- bindings/js/ScriptController.cpp:
(WebCore::ScriptController::eventHandlerPosition):
- bindings/js/ScriptSourceCode.h:
(WebCore::ScriptSourceCode::ScriptSourceCode):
(WebCore::CSSStyleSheet::create):
- dom/ScriptElement.h:
- html/parser/HTMLTreeBuilder.cpp:
(WebCore::uninitializedPositionValue1):
- inspector/InspectorStyleSheet.cpp:
(WebCore::InspectorStyleSheet::buildObjectForStyleSheetInfo): Adopt
default construtor.
(WebCore::XMLErrors::XMLErrors):
(WebCore::XMLErrors::handleError):
- xml/XMLErrors.h: Use std::optional instead of belowRangePosition()
because in-band signaling is harder to reason about.
- xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::textPosition): Adopt default constructor.
Source/WebKit/win:
Adopt default constructor.
- Plugins/PluginPackage.cpp:
(WebCore::makeSource):
Source/WTF:
(WTF::TextPosition::minimumPosition): Deleted. Just use the default
constructor. Other numbers use their default constructors to mean zero.
Any time you need a comment that says "used as a default value", that's
a pretty good indicator that it should be the default constructor.