[webkit-reviews] review granted: [Bug 190026] Web Inspector: Canvas: replace constant numbers with their associated name on WebGL contexts : [Attachment 350938] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 1 11:42:49 PDT 2018


Joseph Pecoraro <joepeck at webkit.org> has granted Devin Rousso
<drousso at apple.com>'s request for review:
Bug 190026: Web Inspector: Canvas: replace constant numbers with their
associated name on WebGL contexts
https://bugs.webkit.org/show_bug.cgi?id=190026

Attachment 350938: Patch

https://bugs.webkit.org/attachment.cgi?id=350938&action=review




--- Comment #3 from Joseph Pecoraro <joepeck at webkit.org> ---
Comment on attachment 350938
  --> https://bugs.webkit.org/attachment.cgi?id=350938
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=350938&action=review

r=me

> Source/WebInspectorUI/UserInterface/Models/RecordingAction.js:117
> +	   let prototype = WI.RecordingAction._prototypeForType(type);
> +	   for (let key in prototype) {
> +	       let descriptor = Object.getOwnPropertyDescriptor(prototype,
key);
> +	       if (descriptor.value === value)
> +		   return key;
> +	   }

Nice!

Should we avoid a few keys? For example if we're in a spot with the value zero,
there would be multiple options and it seems the first one we come across would
be the one returned:

    NONE: 0
    NO_ERROR: 0
    POINTS: 0
    ZERO: 0

Or maybe we've just limited the constant indexes to a better set that will have
useful non-ambugious constants.


More information about the webkit-reviews mailing list