javascript-decorators icon indicating copy to clipboard operation
javascript-decorators copied to clipboard

typo, wrong return value or parameter name

Open fi0rini opened this issue 8 years ago • 3 comments

in README.md the first decorator takes description as a parameter, changes descriptor in the function body and then returns descriptor. I think it should change description in function body and then return description.

fi0rini avatar Dec 04 '15 00:12 fi0rini

Close, outdated?

silkentrance avatar Feb 28 '16 22:02 silkentrance

descriptors seem to be immutable, so if one needs to alter a given descriptor, one has to clone it and then return the clone, possibly modified.

silkentrance avatar Mar 04 '16 22:03 silkentrance

It is my understanding that @nf071590 is referencing the following from the examples in the doc:

function nonenumerable(target, name, description) {
  descriptor.enumerable = false;
  return descriptor;
}

Note that the parameter description does not match the variable used within the function body named descriptor (r vs. n). The fix would simply change the parameter name to descriptor.

yleviel avatar Sep 17 '16 15:09 yleviel