소스 검색

LibWeb: Change IDL::parse_interface's return type to NonnullOwnPtr

We always returned an interface, so there's no need for the null state.
Idan Horowitz 3 년 전
부모
커밋
87f655f2af
1개의 변경된 파일1개의 추가작업 그리고 6개의 파일을 삭제
  1. 1 6
      Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator.cpp

+ 1 - 6
Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator.cpp

@@ -167,7 +167,7 @@ struct Interface {
     bool is_legacy_platform_object() const { return !extended_attributes.contains("Global") && (supports_indexed_properties() || supports_named_properties()); }
 };
 
-static OwnPtr<Interface> parse_interface(StringView filename, StringView const& input)
+static NonnullOwnPtr<Interface> parse_interface(StringView filename, StringView const& input)
 {
     auto interface = make<Interface>();
 
@@ -619,11 +619,6 @@ int main(int argc, char** argv)
     auto data = file_or_error.value()->read_all();
     auto interface = IDL::parse_interface(path, data);
 
-    if (!interface) {
-        warnln("Cannot parse {}", path);
-        return 1;
-    }
-
     if (namespace_.is_one_of("CSS", "DOM", "HTML", "UIEvents", "Geometry", "HighResolutionTime", "NavigationTiming", "RequestIdleCallback", "SVG", "XHR", "URL")) {
         StringBuilder builder;
         builder.append(namespace_);