Classes marked final should not use protected access specifier
Created attachment 397040 [details] Patch
Created attachment 397041 [details] Patch
The code movement in this patch presents a lot of noise that will make it more difficult to blame / investigate history. Is the movement worth it?
Created attachment 397043 [details] Patch
(In reply to Joseph Pecoraro from comment #3) > The code movement in this patch presents a lot of noise that will make it > more difficult to blame / investigate history. Is the movement worth it? I'd started with just JSC and figured it'd be beneficial to keep things consistently ordered (at least with, say, constructors and finishCreation) as well as to remove any public/private back-and-forth where trivial. I applied that idea to other areas of the codebase too; the WebCore cases might be more questionable but I think the WKL/win cases are pretty nice. Anyway you're free to object, but I feel like constructor declarations would be comparatively rare lines to blame?
Comment on attachment 397040 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=397040&action=review > Source/JavaScriptCore/ChangeLog:3 > + Classes marked final should not use protected access specifier Great rule of thumb! I would say the same about *any* classes that have no classes derived from them, even if they aren’t marked final. > Source/JavaScriptCore/runtime/Structure.h:-176 > -public: This says "public", not "private"!!!
I think a little bit of code movements is worth it for clarity.
(In reply to Darin Adler from comment #6) > Comment on attachment 397040 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=397040&action=review > > > Source/JavaScriptCore/ChangeLog:3 > > + Classes marked final should not use protected access specifier > > Great rule of thumb! I would say the same about *any* classes that have no > classes derived from them, even if they aren’t marked final. Indeed -- Yusuke pointed out that JSC even has optimizations that can apply to classes marked final, though for this patch I'm not sure I want to go through all the protected-without-final cases, haha. > > Source/JavaScriptCore/runtime/Structure.h:-176 > > -public: > > This says "public", not "private"!!! Yeah, it seems I was moving a bit too quickly on a few of these. 😅
Created attachment 397046 [details] Patch
Comment on attachment 397046 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=397046&action=review Patch looks good.
Comment on attachment 397046 [details] Patch (In reply to Daniel Bates from comment #12) > Comment on attachment 397046 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=397046&action=review > > Patch looks good. Thanks for the review!
Committed r260415: <https://trac.webkit.org/changeset/260415> All reviewed patches have been landed. Closing bug and clearing flags on attachment 397046 [details].
<rdar://problem/62092856>