javascript-decorators
javascript-decorators copied to clipboard
typo, wrong return value or parameter name
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.
Close, outdated?
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.
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
.