Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Algorithmize the ImageData constructor #3536

Merged
merged 1 commit into from Mar 7, 2018
Merged

Algorithmize the ImageData constructor #3536

merged 1 commit into from Mar 7, 2018

Conversation

Ms2ger
Copy link
Member

@Ms2ger Ms2ger commented Mar 6, 2018

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM. I have left review comments on optional cleanups you could perform while in the area, but feel free to say you're not interested. This is a straightforward refactoring of a dense paragraph into distinct steps and that's unambiguously a good idea, regardless of whether further modernization gets performed.

nonzero, then return the new <code>ImageData</code> object. If one or both of <var>sw</var> and
<var>sh</var> are zero, then the constructor must throw an
<span>"<code>IndexSizeError</code>"</span> <code>DOMException</code> instead.</p>
numeric arguments <var>sw</var> and <var>sh</var>, it must run these steps:</p>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New style is <code ...>ImageData(<var>sw</var>, <var>sh</var>)</code>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you changed that then you also need to change the subsequent paragraph somehow I think.

<span>"<code>IndexSizeError</code>"</span> <code>DOMException</code>.</p></li>

<li><p><span>Create an <code>ImageData</code> object</span> with parameter
<var>pixelsPerRow</var> set to <var>sw</var>, and <var>rows</var> set to <var>sh</var>.</p></li>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be ideal to give this a variable name, e.g. "Let imageData be the result of creating..." Then the next two steps could refer to it by that variable name.

It sems like the comma before "and" is unnecessary.

@domenic domenic added the clarification Standard could be clearer label Mar 7, 2018
@Ms2ger
Copy link
Member Author

Ms2ger commented Mar 7, 2018

If you're willing to merge as-is, please do :)

@domenic domenic merged commit 9c0619a into master Mar 7, 2018
@domenic domenic deleted the ImageData-ctor branch March 7, 2018 08:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clarification Standard could be clearer
Development

Successfully merging this pull request may close these issues.

None yet

3 participants