Ignore:
Timestamp:
Dec 9, 2016, 2:04:14 PM (8 years ago)
Author:
[email protected]
Message:

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.

  • API/JSBase.cpp:

(JSEvaluateScript):
(JSCheckScriptSyntax):

  • API/JSObjectRef.cpp:

(JSObjectMakeFunction):

  • API/JSScriptRef.cpp:

(OpaqueJSScript::OpaqueJSScript):

  • jsc.cpp:

(functionCheckModuleSyntax):

  • parser/SourceCode.h:

(JSC::makeSource):

  • parser/SourceProvider.h:

(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):

  • css/CSSStyleSheet.cpp:

(WebCore::CSSStyleSheet::create):

  • dom/ScriptElement.h:
  • html/parser/HTMLTreeBuilder.cpp:

(WebCore::uninitializedPositionValue1):

  • inspector/InspectorStyleSheet.cpp:

(WebCore::InspectorStyleSheet::buildObjectForStyleSheetInfo): Adopt
default construtor.

  • xml/XMLErrors.cpp:

(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/text/TextPosition.h:

(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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/jsc.cpp

    r209560 r209627  
    24302430
    24312431    ParserError error;
    2432     bool validSyntax = checkModuleSyntax(exec, makeSource(source, String(), TextPosition::minimumPosition(), SourceProviderSourceType::Module), error);
     2432    bool validSyntax = checkModuleSyntax(exec, makeSource(source, String(), TextPosition(), SourceProviderSourceType::Module), error);
    24332433    stopWatch.stop();
    24342434
Note: See TracChangeset for help on using the changeset viewer.