Summary: | Web Inspector: ObjC Protocol Interfaces should throw exceptions for nil arguments | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Joseph Pecoraro <joepeck> | ||||
Component: | Web Inspector | Assignee: | Joseph Pecoraro <joepeck> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | burg, commit-queue, graouts, joepeck, timothy, webkit-bug-importer | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | 528+ (Nightly build) | ||||||
Hardware: | All | ||||||
OS: | All | ||||||
Attachments: |
|
Description
Joseph Pecoraro
2014-10-30 12:18:48 PDT
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`) |