Opened 10 years ago

Closed 10 years ago

#9415 closed defect (fixed)

[patch][cla]dojo.colorFromArray: API documentation differs from implementation

Reported by: JJ Kress Owned by: Eugene Lazutkin
Priority: high Milestone: 1.4
Component: Core Version: 1.3.0
Keywords: Cc:
Blocked By: Blocking:

Description

The implementation of the function differs from the inline documentation, which states that one can create a Color object from an array with 1-4 elements. The implementation clearly fails with 1-2 element arrays.

I opted to create a patch to reintroduce the functionality, as it was (accidently?) removed with changeset [9691] instead of patching the inline documentation.

Patch attached

Attachments (2)

Color.js.patch (717 bytes) - added by JJ Kress 10 years ago.
Color.js.inlinedoc.patch (656 bytes) - added by JJ Kress 10 years ago.
Only correcting the inline documentation

Download all attachments as: .zip

Change History (7)

Changed 10 years ago by JJ Kress

Attachment: Color.js.patch added

comment:1 Changed 10 years ago by Eugene Lazutkin

Owner: changed from anonymous to Eugene Lazutkin
Status: newassigned

comment:2 Changed 10 years ago by Eugene Lazutkin

Actually it was intentional. We eliminated rarely needed functionality from the base:

  • Reducing the base.
  • Improving the performance in the most frequent case.

But the inline documentation was not updated.

The greyscale case is covered by dojo.colors.makeGrey() in dojo/colors.js.

comment:3 Changed 10 years ago by JJ Kress

OK. The documentation at docs.dojocampus.org was already updated a while ago to reflect the current situation. But I didn't check other documentation (e.g. books) whether they copied the inline docs without checking (as the dojocampus docs did).

I tried to make the code patch as small as possible (definitely smaller and simpler than the original code). However I attached a second patch that just updates the documentation and adds an example to it. It's your call how to proceed.

I will add the details of what works and what doesn't work to dojocampus asap (which is my priority/motivation for the patchs).

Changed 10 years ago by JJ Kress

Attachment: Color.js.inlinedoc.patch added

Only correcting the inline documentation

comment:4 Changed 10 years ago by Eugene Lazutkin

Milestone: tbd1.4

Thank you, jjkress, again, for taking care of inline docs --- that is one area we need help the most.

comment:5 Changed 10 years ago by Eugene Lazutkin

Resolution: fixed
Status: assignedclosed

(In [19074]) Changing the inline docs for dojo.colorFromArray + cleaning up trailing whitespaces, thx jjkress!, !strict, fixes #9415.

Note: See TracTickets for help on using tickets.