xslate / p5-Mouse

Lightweight class builder for Perl, as a subset of Moose
https://metacpan.org/release/Mouse
Other
46 stars 32 forks source link

CPAN Pull Request Challenge 2015 #46

Closed fluca1978 closed 9 years ago

fluca1978 commented 9 years ago

This is a tiny set of commits to improve the already high quality module. I took a look at a couple of open issues and tried to find out a good solution, as well as doing some minor changes to the style of some small pieces of code in order to improve readability. Hope this can help.

tm604 commented 9 years ago

Just one minor point: I think 86d0921 should be reverted, or at least raised separately. Most of the affected methods look like they return scalar values, so replacing 'return undef' with 'return;' will break code such as this:

somefunc($x->find_method_by_name('some_missing_name'), 123)

since it'll end up calling somefunc(123) if the 'some_missing_name' method isn't found.

Also, if this didn't cause test failures then I'd suggest it's worth adding some tests to verify that those methods still return undef in list context.

fluca1978 commented 9 years ago

While I believe it can be cherry-picked, I've created another branch without the offending commit about the return undef.

fluca1978 commented 9 years ago

See here https://github.com/gfx/p5-Mouse/pull/48