* SUMMARY Improved type checking and enforcement of correct inspector protocol types by throwing exceptions if required ObjC protocol objects are nil.
<rdar://problem/18827853>
Created attachment 240769 [details] [PATCH] Proposed Fix The following convenience macros are defined in RWIProtocolJSONInternal.h, which these files include. > #define THROW_EXCEPTION_FOR_NIL_KEY(expr) \ > if (!expr) \ > [NSException raise:NSInvalidArgumentException format:@"cannot set property with nil key"]; > > #define THROW_EXCEPTION_FOR_NIL_VALUE(expr) \ > if (!expr) \ > [NSException raise:NSInvalidArgumentException format:@"cannot set property to nil value"]; > > #define THROW_EXCEPTION_FOR_REQUIRED_PROPERTY(expr, propertyName) \ > if (!expr) \ > [NSException raise:NSInvalidArgumentException format:@"required property '%@' cannot be nil", propertyName]; > > #define THROW_EXCEPTION_FOR_REQUIRED_PARAMETER(expr, parameterName) \ > if (!expr) \ > [NSException raise:NSInvalidArgumentException format:@"required parameter '%@' cannot be nil", parameterName]; > > #define THROW_EXCEPTION_FOR_BAD_OPTIONAL_PARAMETER(expr, parameterName) \ > if (expr && !*expr) \ > [NSException raise:NSInvalidArgumentException format:@"optional parameter '%@' cannot be nil", parameterName]; The top ones are only used by RWIProtocolJSON for generic methods like -setString:forKey, -setObject:forKey:, ...
This patch modifies the inspector protocol generator. Please ensure that you have rebaselined any generator test results (i.e., by running `Tools/Scripts/run-inspector-generator-tests --reset-results`)
https://trac.webkit.org/r175479