Changeset 212462 in webkit
- Timestamp:
- Feb 16, 2017 1:31:17 PM (7 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r212458 r212462 1 2017-02-15 Brian Burg <bburg@apple.com> 2 3 [Cocoa] Web Inspector: Inspector::fromProtocolString<T> should return std::optional<T> 4 https://bugs.webkit.org/show_bug.cgi?id=168018 5 <rdar://problem/30468779> 6 7 Reviewed by Joseph Pecoraro. 8 9 These methods parse untrusted string inputs, so they should return an optional instead 10 of asserting or crashing when the input is not usable. 11 12 Update various pieces of generated code to handle the error case gracefully. 13 14 * inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py: 15 (ObjCBackendDispatcherImplementationGenerator._generate_conversions_for_command): 16 (ObjCBackendDispatcherImplementationGenerator._generate_invocation_for_command): 17 The local variable holding the ObjC-friendly converted value should take a std::optional 18 when converting an enum from a string into an NS_ENUM value. If the enum command parameter 19 is not optional, then send a response with a command failure message and return. 20 21 The optional enum parameter case is not handled correctly, but no existing code requires it. 22 23 * inspector/scripts/codegen/generate_objc_protocol_type_conversions_header.py: 24 (ObjCProtocolTypeConversionsHeaderGenerator._generate_enum_from_protocol_string): 25 Fix signature and remove default case ASSERT_NOT_REACHED. 26 27 * inspector/scripts/codegen/generate_objc_protocol_type_conversions_implementation.py: 28 (ObjCProtocolTypeConversionsImplementationGenerator._generate_type_factory_method_implementation): 29 Since this code assumes all inputs to be valid and throws an exception otherwise, we 30 try to convert the enum and throw an exception if it's nullopt. If it's valid, write to outValue. 31 32 * inspector/scripts/codegen/generate_objc_protocol_types_implementation.py: 33 (ObjCProtocolTypesImplementationGenerator._generate_init_method_for_payload): 34 The local variable holding the ObjC-friendly converted value should take a std::optional 35 when converting an enum from a string into an NS_ENUM value. If the enum command parameter 36 is not optional, then throw an exception if the value is nullopt. Otherwise, allow it to be empty. 37 38 * inspector/scripts/codegen/objc_generator.py: 39 (ObjCGenerator.protocol_to_objc_expression_for_member): 40 Unconditionally unwrap the optional. This expression is only used inside the typechecked 41 ObjC protocol objects. In this case we are guaranteed to have already initialized the enum with a valid 42 value, but must store it as a string inside a wrapped InspectorObject. The getter needs to 43 re-convert the stored string into an NS_ENUM value. 44 45 * inspector/scripts/codegen/objc_generator_templates.py: 46 Update type template for fromProtocolString<T>(). 47 48 * inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result: 49 * inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result: 50 * inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result: 51 * inspector/scripts/tests/generic/expected/definitions-with-mac-platform.json-result: 52 * inspector/scripts/tests/generic/expected/domain-availability.json-result: 53 * inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result: 54 * inspector/scripts/tests/generic/expected/enum-values.json-result: 55 * inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result: 56 * inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result: 57 * inspector/scripts/tests/generic/expected/same-type-id-different-domain.json-result: 58 * inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result: 59 * inspector/scripts/tests/generic/expected/type-declaration-aliased-primitive-type.json-result: 60 * inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result: 61 * inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result: 62 * inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result: 63 * inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result: 64 * inspector/scripts/tests/generic/expected/worker-supported-domains.json-result: 65 * inspector/scripts/tests/ios/expected/definitions-with-mac-platform.json-result: 66 * inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result: 67 Rebaseline tests. 68 1 69 2017-02-16 Keith Miller <keith_miller@apple.com> 2 70 -
trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_backend_dispatcher_implementation.py
r210309 r212462 169 169 objc_in_param_name = 'o_%s' % in_param_name 170 170 objc_type = self.objc_type_for_param(domain, command.command_name, parameter, False) 171 if isinstance(parameter.type, EnumType): 172 objc_type = 'std::optional<%s>' % objc_type 171 173 param_expression = in_param_expression(in_param_name, parameter) 172 174 import_expression = self.objc_protocol_import_expression_for_parameter(param_expression, domain, command.command_name, parameter) 173 175 if not parameter.is_optional: 174 176 lines.append(' %s = %s;' % (join_type_and_name(objc_type, objc_in_param_name), import_expression)) 177 178 if isinstance(parameter.type, EnumType): 179 lines.append(' if (!%s) {' % objc_in_param_name) 180 lines.append(' backendDispatcher()->reportProtocolError(BackendDispatcher::InvalidParams, String::format("Parameter \'%%s\' of method \'%%s\' cannot be processed", "%s", "%s.%s"));' % (parameter.parameter_name, domain.domain_name, command.command_name)) 181 lines.append(' return;') 182 lines.append(' }') 183 175 184 else: 176 185 lines.append(' %s;' % join_type_and_name(objc_type, objc_in_param_name)) … … 188 197 for parameter in command.call_parameters: 189 198 in_param_name = 'in_%s' % parameter.parameter_name 190 objc_in_param_ name= 'o_%s' % in_param_name199 objc_in_param_expression = 'o_%s' % in_param_name 191 200 if not parameter.is_optional: 192 pairs.append('%s:%s' % (parameter.parameter_name, objc_in_param_name)) 201 # FIXME: we don't handle optional enum values in commands here because it isn't used anywhere yet. 202 # We'd need to change the delegate's signature to take std::optional for optional enum values. 203 if isinstance(parameter.type, EnumType): 204 objc_in_param_expression = '%s.value()' % objc_in_param_expression 205 206 pairs.append('%s:%s' % (parameter.parameter_name, objc_in_param_expression)) 193 207 else: 194 optional_expression = '(%s ? &%s : nil)' % (in_param_name, objc_in_param_ name)208 optional_expression = '(%s ? &%s : nil)' % (in_param_name, objc_in_param_expression) 195 209 pairs.append('%s:%s' % (parameter.parameter_name, optional_expression)) 196 210 return ' [m_delegate %s%s];' % (command.command_name, ' '.join(pairs)) -
trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_type_conversions_header.py
r212116 r212462 156 156 lines = [] 157 157 lines.append('template<>') 158 lines.append('inline %sfromProtocolString(const String& value)' % objc_enum_name)158 lines.append('inline std::optional<%s> fromProtocolString(const String& value)' % objc_enum_name) 159 159 lines.append('{') 160 160 for enum_value in enum_values: 161 161 lines.append(' if (value == "%s")' % enum_value) 162 162 lines.append(' return %s%s;' % (objc_enum_name, Generator.stylized_name_for_enum_value(enum_value))) 163 lines.append(' ASSERT_NOT_REACHED();') 164 lines.append(' return %s%s;' % (objc_enum_name, Generator.stylized_name_for_enum_value(enum_values[0]))) 163 lines.append(' return std::nullopt;') 165 164 lines.append('}') 166 165 return '\n'.join(lines) -
trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_type_conversions_implementation.py
r210309 r212462 126 126 if isinstance(resolved_type, EnumType): 127 127 lines.append(' THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]);') 128 lines.append(' *outValue = @(Inspector::fromProtocolString<%s>(payload));' % self.objc_name_for_type(resolved_type)) 128 lines.append(' std::optional<%(type)s> result = Inspector::fromProtocolString<%(type)s>(payload);' % {'type': self.objc_name_for_type(resolved_type)}) 129 lines.append(' THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"%s");' % declaration.type.raw_name()) 130 lines.append(' *outValue = @(result.value());') 129 131 elif isinstance(resolved_type, (ArrayType, PrimitiveType)): 130 132 lines.append(' THROW_EXCEPTION_FOR_BAD_TYPE(payload, [%s class]);' % objc_class) -
trunk/Source/JavaScriptCore/inspector/scripts/codegen/generate_objc_protocol_types_implementation.py
r212157 r212462 31 31 32 32 from generator import Generator, ucfirst 33 from models import ObjectType, Frameworks33 from models import ObjectType, EnumType, Frameworks 34 34 from objc_generator import ObjCGenerator 35 35 from objc_generator_templates import ObjCGeneratorTemplates as ObjCTemplates … … 130 130 for member in declaration.type_members: 131 131 member_name = member.member_name 132 conversion_expression = self.payload_to_objc_expression_for_member(declaration, member)133 132 134 133 if not member.is_optional: 135 134 lines.append(' THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"%s"], @"%s");' % (member_name, member_name)) 136 135 136 objc_type = self.objc_type_for_member(declaration, member) 137 137 var_name = ObjCGenerator.identifier_to_objc_identifier(member_name) 138 lines.append(' self.%s = %s;' % (var_name, conversion_expression)) 138 conversion_expression = self.payload_to_objc_expression_for_member(declaration, member) 139 if isinstance(member.type, EnumType): 140 lines.append(' std::optional<%s> %s = %s;' % (objc_type, var_name, conversion_expression)) 141 if not member.is_optional: 142 lines.append(' THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(%s, @"%s");' % (var_name, member_name)) 143 lines.append(' self.%s = %s.value();' % (var_name, var_name)) 144 else: 145 lines.append(' if (%s)' % var_name) 146 lines.append(' self.%s = %s.value();' % (var_name, var_name)) 147 else: 148 lines.append(' self.%s = %s;' % (var_name, conversion_expression)) 149 139 150 lines.append('') 140 151 -
trunk/Source/JavaScriptCore/inspector/scripts/codegen/objc_generator.py
r210309 r212462 443 443 if isinstance(member.type, EnumType): 444 444 if member.type.is_anonymous: 445 return 'fromProtocolString<%s>(%s) ' % (self.objc_enum_name_for_anonymous_enum_member(declaration, member), sub_expression)446 return 'fromProtocolString<%s>(%s) ' % (self.objc_enum_name_for_non_anonymous_enum(member.type), sub_expression)445 return 'fromProtocolString<%s>(%s).value()' % (self.objc_enum_name_for_anonymous_enum_member(declaration, member), sub_expression) 446 return 'fromProtocolString<%s>(%s).value()' % (self.objc_enum_name_for_non_anonymous_enum(member.type), sub_expression) 447 447 return sub_expression 448 448 if category is ObjCTypeCategory.Object: -
trunk/Source/JavaScriptCore/inspector/scripts/codegen/objc_generator_templates.py
r210852 r212462 56 56 TypeConversionsHeaderStandard = ( 57 57 """template<typename ObjCEnumType> 58 ObjCEnumTypefromProtocolString(const String& value);""")58 std::optional<ObjCEnumType> fromProtocolString(const String& value);""") 59 59 60 60 BackendDispatcherHeaderPrelude = ( -
trunk/Source/JavaScriptCore/inspector/scripts/tests/all/expected/definitions-with-mac-platform.json-result
r212116 r212462 1007 1007 1008 1008 template<typename ObjCEnumType> 1009 ObjCEnumTypefromProtocolString(const String& value);1009 std::optional<ObjCEnumType> fromProtocolString(const String& value); 1010 1010 1011 1011 inline String toProtocolString(TestProtocolPlatform value) … … 1024 1024 1025 1025 template<> 1026 inline TestProtocolPlatformfromProtocolString(const String& value)1026 inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) 1027 1027 { 1028 1028 if (value == "all") … … 1034 1034 if (value == "macos") 1035 1035 return TestProtocolPlatformMacOS; 1036 ASSERT_NOT_REACHED(); 1037 return TestProtocolPlatformAll; 1036 return std::nullopt; 1038 1037 } 1039 1038 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-async-attribute.json-result
r212116 r212462 1426 1426 1427 1427 template<typename ObjCEnumType> 1428 ObjCEnumTypefromProtocolString(const String& value);1428 std::optional<ObjCEnumType> fromProtocolString(const String& value); 1429 1429 1430 1430 inline String toProtocolString(TestProtocolPlatform value) … … 1443 1443 1444 1444 template<> 1445 inline TestProtocolPlatformfromProtocolString(const String& value)1445 inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) 1446 1446 { 1447 1447 if (value == "all") … … 1453 1453 if (value == "macos") 1454 1454 return TestProtocolPlatformMacOS; 1455 ASSERT_NOT_REACHED(); 1456 return TestProtocolPlatformAll; 1455 return std::nullopt; 1457 1456 } 1458 1457 … … 1471 1470 1472 1471 template<> 1473 inline TestProtocolDatabasePrimaryColorsfromProtocolString(const String& value)1472 inline std::optional<TestProtocolDatabasePrimaryColors> fromProtocolString(const String& value) 1474 1473 { 1475 1474 if (value == "red") … … 1479 1478 if (value == "blue") 1480 1479 return TestProtocolDatabasePrimaryColorsBlue; 1481 ASSERT_NOT_REACHED(); 1482 return TestProtocolDatabasePrimaryColorsRed; 1480 return std::nullopt; 1483 1481 } 1484 1482 … … 1498 1496 1499 1497 template<> 1500 inline TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorfromProtocolString(const String& value)1498 inline std::optional<TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColor> fromProtocolString(const String& value) 1501 1499 { 1502 1500 if (value == "cyan") … … 1508 1506 if (value == "black") 1509 1507 return TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorBlack; 1510 ASSERT_NOT_REACHED(); 1511 return TestProtocolDatabaseExecuteSQLSyncOptionalReturnValuesPrintColorCyan; 1508 return std::nullopt; 1512 1509 } 1513 1510 … … 1527 1524 1528 1525 template<> 1529 inline TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorfromProtocolString(const String& value)1526 inline std::optional<TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColor> fromProtocolString(const String& value) 1530 1527 { 1531 1528 if (value == "cyan") … … 1537 1534 if (value == "black") 1538 1535 return TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorBlack; 1539 ASSERT_NOT_REACHED(); 1540 return TestProtocolDatabaseExecuteSQLAsyncOptionalReturnValuesPrintColorCyan; 1536 return std::nullopt; 1541 1537 } 1542 1538 … … 1556 1552 1557 1553 template<> 1558 inline TestProtocolDatabaseExecuteSQLSyncPrintColorfromProtocolString(const String& value)1554 inline std::optional<TestProtocolDatabaseExecuteSQLSyncPrintColor> fromProtocolString(const String& value) 1559 1555 { 1560 1556 if (value == "cyan") … … 1566 1562 if (value == "black") 1567 1563 return TestProtocolDatabaseExecuteSQLSyncPrintColorBlack; 1568 ASSERT_NOT_REACHED(); 1569 return TestProtocolDatabaseExecuteSQLSyncPrintColorCyan; 1564 return std::nullopt; 1570 1565 } 1571 1566 … … 1585 1580 1586 1581 template<> 1587 inline TestProtocolDatabaseExecuteSQLAsyncPrintColorfromProtocolString(const String& value)1582 inline std::optional<TestProtocolDatabaseExecuteSQLAsyncPrintColor> fromProtocolString(const String& value) 1588 1583 { 1589 1584 if (value == "cyan") … … 1595 1590 if (value == "black") 1596 1591 return TestProtocolDatabaseExecuteSQLAsyncPrintColorBlack; 1597 ASSERT_NOT_REACHED(); 1598 return TestProtocolDatabaseExecuteSQLAsyncPrintColorCyan; 1592 return std::nullopt; 1599 1593 } 1600 1594 … … 1662 1656 { 1663 1657 THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); 1664 *outValue = @(Inspector::fromProtocolString<TestProtocolDatabasePrimaryColors>(payload)); 1658 std::optional<TestProtocolDatabasePrimaryColors> result = Inspector::fromProtocolString<TestProtocolDatabasePrimaryColors>(payload); 1659 THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"PrimaryColors"); 1660 *outValue = @(result.value()); 1665 1661 } 1666 1662 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/commands-with-optional-call-return-parameters.json-result
r212116 r212462 873 873 if (in_sqlError) 874 874 o_in_sqlError = [[[TestProtocolDatabaseError alloc] initWithInspectorObject:in_sqlError] autorelease]; 875 TestProtocolDatabasePrimaryColorso_in_screenColor;875 std::optional<TestProtocolDatabasePrimaryColors> o_in_screenColor; 876 876 if (in_screenColor) 877 877 o_in_screenColor = fromProtocolString<TestProtocolDatabasePrimaryColors>(*in_screenColor); … … 879 879 if (in_alternateColors) 880 880 o_in_alternateColors = objcStringArray(in_alternateColors); 881 TestProtocolDatabaseExecuteAllOptionalParametersPrintColoro_in_printColor;881 std::optional<TestProtocolDatabaseExecuteAllOptionalParametersPrintColor> o_in_printColor; 882 882 if (in_printColor) 883 883 o_in_printColor = fromProtocolString<TestProtocolDatabaseExecuteAllOptionalParametersPrintColor>(*in_printColor); … … 921 921 int o_in_databaseId = in_databaseId; 922 922 TestProtocolDatabaseError *o_in_sqlError = [[[TestProtocolDatabaseError alloc] initWithInspectorObject:&in_sqlError] autorelease]; 923 TestProtocolDatabasePrimaryColors o_in_screenColor = fromProtocolString<TestProtocolDatabasePrimaryColors>(in_screenColor); 923 std::optional<TestProtocolDatabasePrimaryColors> o_in_screenColor = fromProtocolString<TestProtocolDatabasePrimaryColors>(in_screenColor); 924 if (!o_in_screenColor) { 925 backendDispatcher()->reportProtocolError(BackendDispatcher::InvalidParams, String::format("Parameter '%s' of method '%s' cannot be processed", "screenColor", "Database.executeNoOptionalParameters")); 926 return; 927 } 924 928 NSArray/*<NSString>*/ *o_in_alternateColors = objcStringArray(&in_alternateColors); 925 TestProtocolDatabaseExecuteNoOptionalParametersPrintColor o_in_printColor = fromProtocolString<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor>(in_printColor); 926 927 [m_delegate executeNoOptionalParametersWithErrorCallback:errorCallback successCallback:successCallback columnNames:o_in_columnNames notes:o_in_notes timestamp:o_in_timestamp values:o_in_values payload:o_in_payload databaseId:o_in_databaseId sqlError:o_in_sqlError screenColor:o_in_screenColor alternateColors:o_in_alternateColors printColor:o_in_printColor]; 929 std::optional<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor> o_in_printColor = fromProtocolString<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor>(in_printColor); 930 if (!o_in_printColor) { 931 backendDispatcher()->reportProtocolError(BackendDispatcher::InvalidParams, String::format("Parameter '%s' of method '%s' cannot be processed", "printColor", "Database.executeNoOptionalParameters")); 932 return; 933 } 934 935 [m_delegate executeNoOptionalParametersWithErrorCallback:errorCallback successCallback:successCallback columnNames:o_in_columnNames notes:o_in_notes timestamp:o_in_timestamp values:o_in_values payload:o_in_payload databaseId:o_in_databaseId sqlError:o_in_sqlError screenColor:o_in_screenColor.value() alternateColors:o_in_alternateColors printColor:o_in_printColor.value()]; 928 936 } 929 937 … … 1281 1289 1282 1290 template<typename ObjCEnumType> 1283 ObjCEnumTypefromProtocolString(const String& value);1291 std::optional<ObjCEnumType> fromProtocolString(const String& value); 1284 1292 1285 1293 inline String toProtocolString(TestProtocolPlatform value) … … 1298 1306 1299 1307 template<> 1300 inline TestProtocolPlatformfromProtocolString(const String& value)1308 inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) 1301 1309 { 1302 1310 if (value == "all") … … 1308 1316 if (value == "macos") 1309 1317 return TestProtocolPlatformMacOS; 1310 ASSERT_NOT_REACHED(); 1311 return TestProtocolPlatformAll; 1318 return std::nullopt; 1312 1319 } 1313 1320 … … 1326 1333 1327 1334 template<> 1328 inline TestProtocolDatabasePrimaryColorsfromProtocolString(const String& value)1335 inline std::optional<TestProtocolDatabasePrimaryColors> fromProtocolString(const String& value) 1329 1336 { 1330 1337 if (value == "red") … … 1334 1341 if (value == "blue") 1335 1342 return TestProtocolDatabasePrimaryColorsBlue; 1336 ASSERT_NOT_REACHED(); 1337 return TestProtocolDatabasePrimaryColorsRed; 1343 return std::nullopt; 1338 1344 } 1339 1345 … … 1353 1359 1354 1360 template<> 1355 inline TestProtocolDatabaseExecuteAllOptionalParametersPrintColorfromProtocolString(const String& value)1361 inline std::optional<TestProtocolDatabaseExecuteAllOptionalParametersPrintColor> fromProtocolString(const String& value) 1356 1362 { 1357 1363 if (value == "cyan") … … 1363 1369 if (value == "black") 1364 1370 return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorBlack; 1365 ASSERT_NOT_REACHED(); 1366 return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan; 1371 return std::nullopt; 1367 1372 } 1368 1373 … … 1382 1387 1383 1388 template<> 1384 inline TestProtocolDatabaseExecuteAllOptionalParametersPrintColorfromProtocolString(const String& value)1389 inline std::optional<TestProtocolDatabaseExecuteAllOptionalParametersPrintColor> fromProtocolString(const String& value) 1385 1390 { 1386 1391 if (value == "cyan") … … 1392 1397 if (value == "black") 1393 1398 return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorBlack; 1394 ASSERT_NOT_REACHED(); 1395 return TestProtocolDatabaseExecuteAllOptionalParametersPrintColorCyan; 1399 return std::nullopt; 1396 1400 } 1397 1401 … … 1411 1415 1412 1416 template<> 1413 inline TestProtocolDatabaseExecuteNoOptionalParametersPrintColorfromProtocolString(const String& value)1417 inline std::optional<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor> fromProtocolString(const String& value) 1414 1418 { 1415 1419 if (value == "cyan") … … 1421 1425 if (value == "black") 1422 1426 return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorBlack; 1423 ASSERT_NOT_REACHED(); 1424 return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan; 1427 return std::nullopt; 1425 1428 } 1426 1429 … … 1440 1443 1441 1444 template<> 1442 inline TestProtocolDatabaseExecuteNoOptionalParametersPrintColorfromProtocolString(const String& value)1445 inline std::optional<TestProtocolDatabaseExecuteNoOptionalParametersPrintColor> fromProtocolString(const String& value) 1443 1446 { 1444 1447 if (value == "cyan") … … 1450 1453 if (value == "black") 1451 1454 return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorBlack; 1452 ASSERT_NOT_REACHED(); 1453 return TestProtocolDatabaseExecuteNoOptionalParametersPrintColorCyan; 1455 return std::nullopt; 1454 1456 } 1455 1457 … … 1517 1519 { 1518 1520 THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); 1519 *outValue = @(Inspector::fromProtocolString<TestProtocolDatabasePrimaryColors>(payload)); 1521 std::optional<TestProtocolDatabasePrimaryColors> result = Inspector::fromProtocolString<TestProtocolDatabasePrimaryColors>(payload); 1522 THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"PrimaryColors"); 1523 *outValue = @(result.value()); 1520 1524 } 1521 1525 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/definitions-with-mac-platform.json-result
r212116 r212462 743 743 744 744 template<typename ObjCEnumType> 745 ObjCEnumTypefromProtocolString(const String& value);745 std::optional<ObjCEnumType> fromProtocolString(const String& value); 746 746 747 747 inline String toProtocolString(TestProtocolPlatform value) … … 760 760 761 761 template<> 762 inline TestProtocolPlatformfromProtocolString(const String& value)762 inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) 763 763 { 764 764 if (value == "all") … … 770 770 if (value == "macos") 771 771 return TestProtocolPlatformMacOS; 772 ASSERT_NOT_REACHED(); 773 return TestProtocolPlatformAll; 772 return std::nullopt; 774 773 } 775 774 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domain-availability.json-result
r212116 r212462 997 997 998 998 template<typename ObjCEnumType> 999 ObjCEnumTypefromProtocolString(const String& value);999 std::optional<ObjCEnumType> fromProtocolString(const String& value); 1000 1000 1001 1001 inline String toProtocolString(TestProtocolPlatform value) … … 1014 1014 1015 1015 template<> 1016 inline TestProtocolPlatformfromProtocolString(const String& value)1016 inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) 1017 1017 { 1018 1018 if (value == "all") … … 1024 1024 if (value == "macos") 1025 1025 return TestProtocolPlatformMacOS; 1026 ASSERT_NOT_REACHED(); 1027 return TestProtocolPlatformAll; 1026 return std::nullopt; 1028 1027 } 1029 1028 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/domains-with-varying-command-sizes.json-result
r212116 r212462 1260 1260 1261 1261 template<typename ObjCEnumType> 1262 ObjCEnumTypefromProtocolString(const String& value);1262 std::optional<ObjCEnumType> fromProtocolString(const String& value); 1263 1263 1264 1264 inline String toProtocolString(TestProtocolPlatform value) … … 1277 1277 1278 1278 template<> 1279 inline TestProtocolPlatformfromProtocolString(const String& value)1279 inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) 1280 1280 { 1281 1281 if (value == "all") … … 1287 1287 if (value == "macos") 1288 1288 return TestProtocolPlatformMacOS; 1289 ASSERT_NOT_REACHED(); 1290 return TestProtocolPlatformAll; 1289 return std::nullopt; 1291 1290 } 1292 1291 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/enum-values.json-result
r212116 r212462 1040 1040 1041 1041 template<typename ObjCEnumType> 1042 ObjCEnumTypefromProtocolString(const String& value);1042 std::optional<ObjCEnumType> fromProtocolString(const String& value); 1043 1043 1044 1044 inline String toProtocolString(TestProtocolPlatform value) … … 1057 1057 1058 1058 template<> 1059 inline TestProtocolPlatformfromProtocolString(const String& value)1059 inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) 1060 1060 { 1061 1061 if (value == "all") … … 1067 1067 if (value == "macos") 1068 1068 return TestProtocolPlatformMacOS; 1069 ASSERT_NOT_REACHED(); 1070 return TestProtocolPlatformAll; 1069 return std::nullopt; 1071 1070 } 1072 1071 … … 1087 1086 1088 1087 template<> 1089 inline TestProtocolTypeDomainEnumfromProtocolString(const String& value)1088 inline std::optional<TestProtocolTypeDomainEnum> fromProtocolString(const String& value) 1090 1089 { 1091 1090 if (value == "shared") … … 1097 1096 if (value == "blue") 1098 1097 return TestProtocolTypeDomainEnumBlue; 1099 ASSERT_NOT_REACHED(); 1100 return TestProtocolTypeDomainEnumShared; 1098 return std::nullopt; 1101 1099 } 1102 1100 … … 1155 1153 { 1156 1154 THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); 1157 *outValue = @(Inspector::fromProtocolString<TestProtocolTypeDomainEnum>(payload)); 1155 std::optional<TestProtocolTypeDomainEnum> result = Inspector::fromProtocolString<TestProtocolTypeDomainEnum>(payload); 1156 THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"TypeDomainEnum"); 1157 *outValue = @(result.value()); 1158 1158 } 1159 1159 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/events-with-optional-parameters.json-result
r212116 r212462 993 993 994 994 template<typename ObjCEnumType> 995 ObjCEnumTypefromProtocolString(const String& value);995 std::optional<ObjCEnumType> fromProtocolString(const String& value); 996 996 997 997 inline String toProtocolString(TestProtocolPlatform value) … … 1010 1010 1011 1011 template<> 1012 inline TestProtocolPlatformfromProtocolString(const String& value)1012 inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) 1013 1013 { 1014 1014 if (value == "all") … … 1020 1020 if (value == "macos") 1021 1021 return TestProtocolPlatformMacOS; 1022 ASSERT_NOT_REACHED(); 1023 return TestProtocolPlatformAll; 1022 return std::nullopt; 1024 1023 } 1025 1024 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/generate-domains-with-feature-guards.json-result
r212116 r212462 1034 1034 1035 1035 template<typename ObjCEnumType> 1036 ObjCEnumTypefromProtocolString(const String& value);1036 std::optional<ObjCEnumType> fromProtocolString(const String& value); 1037 1037 1038 1038 inline String toProtocolString(TestProtocolPlatform value) … … 1051 1051 1052 1052 template<> 1053 inline TestProtocolPlatformfromProtocolString(const String& value)1053 inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) 1054 1054 { 1055 1055 if (value == "all") … … 1061 1061 if (value == "macos") 1062 1062 return TestProtocolPlatformMacOS; 1063 ASSERT_NOT_REACHED(); 1064 return TestProtocolPlatformAll; 1063 return std::nullopt; 1065 1064 } 1066 1065 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/same-type-id-different-domain.json-result
r212116 r212462 753 753 754 754 template<typename ObjCEnumType> 755 ObjCEnumTypefromProtocolString(const String& value);755 std::optional<ObjCEnumType> fromProtocolString(const String& value); 756 756 757 757 inline String toProtocolString(TestProtocolPlatform value) … … 770 770 771 771 template<> 772 inline TestProtocolPlatformfromProtocolString(const String& value)772 inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) 773 773 { 774 774 if (value == "all") … … 780 780 if (value == "macos") 781 781 return TestProtocolPlatformMacOS; 782 ASSERT_NOT_REACHED(); 783 return TestProtocolPlatformAll; 782 return std::nullopt; 784 783 } 785 784 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/shadowed-optional-type-setters.json-result
r212116 r212462 890 890 891 891 template<typename ObjCEnumType> 892 ObjCEnumTypefromProtocolString(const String& value);892 std::optional<ObjCEnumType> fromProtocolString(const String& value); 893 893 894 894 inline String toProtocolString(TestProtocolPlatform value) … … 907 907 908 908 template<> 909 inline TestProtocolPlatformfromProtocolString(const String& value)909 inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) 910 910 { 911 911 if (value == "all") … … 917 917 if (value == "macos") 918 918 return TestProtocolPlatformMacOS; 919 ASSERT_NOT_REACHED(); 920 return TestProtocolPlatformAll; 919 return std::nullopt; 921 920 } 922 921 … … 935 934 936 935 template<> 937 inline TestProtocolRuntimeKeyPathTypefromProtocolString(const String& value)936 inline std::optional<TestProtocolRuntimeKeyPathType> fromProtocolString(const String& value) 938 937 { 939 938 if (value == "null") … … 943 942 if (value == "array") 944 943 return TestProtocolRuntimeKeyPathTypeArray; 945 ASSERT_NOT_REACHED(); 946 return TestProtocolRuntimeKeyPathTypeNull; 944 return std::nullopt; 947 945 } 948 946 … … 1058 1056 1059 1057 THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"type"], @"type"); 1060 self.type = fromProtocolString<TestProtocolRuntimeKeyPathType>(payload[@"type"]); 1058 std::optional<TestProtocolRuntimeKeyPathType> type = fromProtocolString<TestProtocolRuntimeKeyPathType>(payload[@"type"]); 1059 THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(type, @"type"); 1060 self.type = type.value(); 1061 1061 1062 1062 self.string = payload[@"string"]; … … 1091 1091 - (TestProtocolRuntimeKeyPathType)type 1092 1092 { 1093 return fromProtocolString<TestProtocolRuntimeKeyPathType>([super stringForKey:@"type"]) ;1093 return fromProtocolString<TestProtocolRuntimeKeyPathType>([super stringForKey:@"type"]).value(); 1094 1094 } 1095 1095 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-aliased-primitive-type.json-result
r212116 r212462 748 748 749 749 template<typename ObjCEnumType> 750 ObjCEnumTypefromProtocolString(const String& value);750 std::optional<ObjCEnumType> fromProtocolString(const String& value); 751 751 752 752 inline String toProtocolString(TestProtocolPlatform value) … … 765 765 766 766 template<> 767 inline TestProtocolPlatformfromProtocolString(const String& value)767 inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) 768 768 { 769 769 if (value == "all") … … 775 775 if (value == "macos") 776 776 return TestProtocolPlatformMacOS; 777 ASSERT_NOT_REACHED(); 778 return TestProtocolPlatformAll; 777 return std::nullopt; 779 778 } 780 779 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-array-type.json-result
r212116 r212462 831 831 832 832 template<typename ObjCEnumType> 833 ObjCEnumTypefromProtocolString(const String& value);833 std::optional<ObjCEnumType> fromProtocolString(const String& value); 834 834 835 835 inline String toProtocolString(TestProtocolPlatform value) … … 848 848 849 849 template<> 850 inline TestProtocolPlatformfromProtocolString(const String& value)850 inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) 851 851 { 852 852 if (value == "all") … … 858 858 if (value == "macos") 859 859 return TestProtocolPlatformMacOS; 860 ASSERT_NOT_REACHED(); 861 return TestProtocolPlatformAll; 860 return std::nullopt; 862 861 } 863 862 … … 876 875 877 876 template<> 878 inline TestProtocolDebuggerReasonfromProtocolString(const String& value)877 inline std::optional<TestProtocolDebuggerReason> fromProtocolString(const String& value) 879 878 { 880 879 if (value == "Died") … … 884 883 if (value == "Hungry") 885 884 return TestProtocolDebuggerReasonHungry; 886 ASSERT_NOT_REACHED(); 887 return TestProtocolDebuggerReasonDied; 885 return std::nullopt; 888 886 } 889 887 … … 961 959 { 962 960 THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); 963 *outValue = @(Inspector::fromProtocolString<TestProtocolDebuggerReason>(payload)); 961 std::optional<TestProtocolDebuggerReason> result = Inspector::fromProtocolString<TestProtocolDebuggerReason>(payload); 962 THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"Reason"); 963 *outValue = @(result.value()); 964 964 } 965 965 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-enum-type.json-result
r212116 r212462 859 859 860 860 template<typename ObjCEnumType> 861 ObjCEnumTypefromProtocolString(const String& value);861 std::optional<ObjCEnumType> fromProtocolString(const String& value); 862 862 863 863 inline String toProtocolString(TestProtocolPlatform value) … … 876 876 877 877 template<> 878 inline TestProtocolPlatformfromProtocolString(const String& value)878 inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) 879 879 { 880 880 if (value == "all") … … 886 886 if (value == "macos") 887 887 return TestProtocolPlatformMacOS; 888 ASSERT_NOT_REACHED(); 889 return TestProtocolPlatformAll; 888 return std::nullopt; 890 889 } 891 890 … … 906 905 907 906 template<> 908 inline TestProtocolRuntimeFarmAnimalsfromProtocolString(const String& value)907 inline std::optional<TestProtocolRuntimeFarmAnimals> fromProtocolString(const String& value) 909 908 { 910 909 if (value == "Pigs") … … 916 915 if (value == "Hens") 917 916 return TestProtocolRuntimeFarmAnimalsHens; 918 ASSERT_NOT_REACHED(); 919 return TestProtocolRuntimeFarmAnimalsPigs; 917 return std::nullopt; 920 918 } 921 919 … … 935 933 936 934 template<> 937 inline TestProtocolRuntimeTwoLeggedAnimalsfromProtocolString(const String& value)935 inline std::optional<TestProtocolRuntimeTwoLeggedAnimals> fromProtocolString(const String& value) 938 936 { 939 937 if (value == "Ducks") … … 945 943 if (value == "Flamingos") 946 944 return TestProtocolRuntimeTwoLeggedAnimalsFlamingos; 947 ASSERT_NOT_REACHED(); 948 return TestProtocolRuntimeTwoLeggedAnimalsDucks; 945 return std::nullopt; 949 946 } 950 947 … … 1004 1001 { 1005 1002 THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); 1006 *outValue = @(Inspector::fromProtocolString<TestProtocolRuntimeFarmAnimals>(payload)); 1003 std::optional<TestProtocolRuntimeFarmAnimals> result = Inspector::fromProtocolString<TestProtocolRuntimeFarmAnimals>(payload); 1004 THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"FarmAnimals"); 1005 *outValue = @(result.value()); 1007 1006 } 1008 1007 … … 1010 1009 { 1011 1010 THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); 1012 *outValue = @(Inspector::fromProtocolString<TestProtocolRuntimeTwoLeggedAnimals>(payload)); 1011 std::optional<TestProtocolRuntimeTwoLeggedAnimals> result = Inspector::fromProtocolString<TestProtocolRuntimeTwoLeggedAnimals>(payload); 1012 THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"TwoLeggedAnimals"); 1013 *outValue = @(result.value()); 1013 1014 } 1014 1015 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-declaration-object-type.json-result
r212116 r212462 1284 1284 1285 1285 template<typename ObjCEnumType> 1286 ObjCEnumTypefromProtocolString(const String& value);1286 std::optional<ObjCEnumType> fromProtocolString(const String& value); 1287 1287 1288 1288 inline String toProtocolString(TestProtocolPlatform value) … … 1301 1301 1302 1302 template<> 1303 inline TestProtocolPlatformfromProtocolString(const String& value)1303 inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) 1304 1304 { 1305 1305 if (value == "all") … … 1311 1311 if (value == "macos") 1312 1312 return TestProtocolPlatformMacOS; 1313 ASSERT_NOT_REACHED(); 1314 return TestProtocolPlatformAll; 1313 return std::nullopt; 1315 1314 } 1316 1315 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/type-requiring-runtime-casts.json-result
r212157 r212462 1213 1213 1214 1214 template<typename ObjCEnumType> 1215 ObjCEnumTypefromProtocolString(const String& value);1215 std::optional<ObjCEnumType> fromProtocolString(const String& value); 1216 1216 1217 1217 inline String toProtocolString(TestProtocolPlatform value) … … 1230 1230 1231 1231 template<> 1232 inline TestProtocolPlatformfromProtocolString(const String& value)1232 inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) 1233 1233 { 1234 1234 if (value == "all") … … 1240 1240 if (value == "macos") 1241 1241 return TestProtocolPlatformMacOS; 1242 ASSERT_NOT_REACHED(); 1243 return TestProtocolPlatformAll; 1242 return std::nullopt; 1244 1243 } 1245 1244 … … 1260 1259 1261 1260 template<> 1262 inline TestProtocolTestUncastedAnimalsfromProtocolString(const String& value)1261 inline std::optional<TestProtocolTestUncastedAnimals> fromProtocolString(const String& value) 1263 1262 { 1264 1263 if (value == "Pigs") … … 1270 1269 if (value == "Hens") 1271 1270 return TestProtocolTestUncastedAnimalsHens; 1272 ASSERT_NOT_REACHED(); 1273 return TestProtocolTestUncastedAnimalsPigs; 1271 return std::nullopt; 1274 1272 } 1275 1273 … … 1289 1287 1290 1288 template<> 1291 inline TestProtocolTestCastedAnimalsfromProtocolString(const String& value)1289 inline std::optional<TestProtocolTestCastedAnimals> fromProtocolString(const String& value) 1292 1290 { 1293 1291 if (value == "Ducks") … … 1299 1297 if (value == "Flamingos") 1300 1298 return TestProtocolTestCastedAnimalsFlamingos; 1301 ASSERT_NOT_REACHED(); 1302 return TestProtocolTestCastedAnimalsDucks; 1299 return std::nullopt; 1303 1300 } 1304 1301 … … 1381 1378 { 1382 1379 THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); 1383 *outValue = @(Inspector::fromProtocolString<TestProtocolTestUncastedAnimals>(payload)); 1380 std::optional<TestProtocolTestUncastedAnimals> result = Inspector::fromProtocolString<TestProtocolTestUncastedAnimals>(payload); 1381 THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"UncastedAnimals"); 1382 *outValue = @(result.value()); 1384 1383 } 1385 1384 … … 1387 1386 { 1388 1387 THROW_EXCEPTION_FOR_BAD_TYPE(payload, [NSString class]); 1389 *outValue = @(Inspector::fromProtocolString<TestProtocolTestCastedAnimals>(payload)); 1388 std::optional<TestProtocolTestCastedAnimals> result = Inspector::fromProtocolString<TestProtocolTestCastedAnimals>(payload); 1389 THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(result, @"CastedAnimals"); 1390 *outValue = @(result.value()); 1390 1391 } 1391 1392 … … 1462 1463 1463 1464 THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"animals"], @"animals"); 1464 self.animals = fromProtocolString<TestProtocolTestCastedAnimals>(payload[@"animals"]); 1465 std::optional<TestProtocolTestCastedAnimals> animals = fromProtocolString<TestProtocolTestCastedAnimals>(payload[@"animals"]); 1466 THROW_EXCEPTION_FOR_BAD_ENUM_VALUE(animals, @"animals"); 1467 self.animals = animals.value(); 1465 1468 1466 1469 THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(payload[@"id"], @"id"); … … 1524 1527 - (TestProtocolTestCastedAnimals)animals 1525 1528 { 1526 return fromProtocolString<TestProtocolTestCastedAnimals>([super stringForKey:@"animals"]) ;1529 return fromProtocolString<TestProtocolTestCastedAnimals>([super stringForKey:@"animals"]).value(); 1527 1530 } 1528 1531 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/generic/expected/worker-supported-domains.json-result
r212116 r212462 998 998 999 999 template<typename ObjCEnumType> 1000 ObjCEnumTypefromProtocolString(const String& value);1000 std::optional<ObjCEnumType> fromProtocolString(const String& value); 1001 1001 1002 1002 inline String toProtocolString(TestProtocolPlatform value) … … 1015 1015 1016 1016 template<> 1017 inline TestProtocolPlatformfromProtocolString(const String& value)1017 inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) 1018 1018 { 1019 1019 if (value == "all") … … 1025 1025 if (value == "macos") 1026 1026 return TestProtocolPlatformMacOS; 1027 ASSERT_NOT_REACHED(); 1028 return TestProtocolPlatformAll; 1027 return std::nullopt; 1029 1028 } 1030 1029 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/ios/expected/definitions-with-mac-platform.json-result
r212116 r212462 743 743 744 744 template<typename ObjCEnumType> 745 ObjCEnumTypefromProtocolString(const String& value);745 std::optional<ObjCEnumType> fromProtocolString(const String& value); 746 746 747 747 inline String toProtocolString(TestProtocolPlatform value) … … 760 760 761 761 template<> 762 inline TestProtocolPlatformfromProtocolString(const String& value)762 inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) 763 763 { 764 764 if (value == "all") … … 770 770 if (value == "macos") 771 771 return TestProtocolPlatformMacOS; 772 ASSERT_NOT_REACHED(); 773 return TestProtocolPlatformAll; 772 return std::nullopt; 774 773 } 775 774 -
trunk/Source/JavaScriptCore/inspector/scripts/tests/mac/expected/definitions-with-mac-platform.json-result
r212116 r212462 1007 1007 1008 1008 template<typename ObjCEnumType> 1009 ObjCEnumTypefromProtocolString(const String& value);1009 std::optional<ObjCEnumType> fromProtocolString(const String& value); 1010 1010 1011 1011 inline String toProtocolString(TestProtocolPlatform value) … … 1024 1024 1025 1025 template<> 1026 inline TestProtocolPlatformfromProtocolString(const String& value)1026 inline std::optional<TestProtocolPlatform> fromProtocolString(const String& value) 1027 1027 { 1028 1028 if (value == "all") … … 1034 1034 if (value == "macos") 1035 1035 return TestProtocolPlatformMacOS; 1036 ASSERT_NOT_REACHED(); 1037 return TestProtocolPlatformAll; 1036 return std::nullopt; 1038 1037 } 1039 1038
Note: See TracChangeset
for help on using the changeset viewer.