In keeping with good Objective-C practice, JSValue should override init and throw an exception since there's not really a way to put the returned object in a coherent state that won't crash at some point later in time. Better to fail fast.
Created attachment 191576 [details] patch
<rdar://problem/13351901>
Comment on attachment 191576 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=191576&action=review > Source/JavaScriptCore/API/JSValue.mm:955 > + @throw [NSException exceptionWithName:@"InvalidMessageException" > + reason:@"JSValue cannot safely support init." > + userInfo:nil]; Why throw? Just return nil. And the initWithValue method should also return nil when the arguments are nil. That’s how Cocoa init functions normally work. Unless I’m missing some compelling argument for throwing exceptions instead. Please don’t align the lines like this. WebKit coding style says just indent 4 spaces.
Created attachment 191579 [details] return nil
Comment on attachment 191579 [details] return nil Need to update ChangeLog.
Created attachment 191582 [details] updated change log
Comment on attachment 191582 [details] updated change log Clearing flags on attachment: 191582 Committed r144843: <http://trac.webkit.org/changeset/144843>
All reviewed patches have been landed. Closing bug.