$string, but using $_

8 views
Skip to first unread message

Ярослав Косьмина

unread,
Aug 23, 2011, 3:49:52 AM8/23/11
to Mojolicious
Mojo/JSON.pm: line 69: sub decode:

sub decode {
my ($self, $string) = @_;

# Cleanup
$self->error(undef);

# Missing input
$self->error('Missing or empty input.') and return unless $string;

# Remove BOM
$string =~ s/^$BOM_RE//go;

# Wide characters
$self->error('Wide character in input.') and return
unless utf8::downgrade($_, 1); # not
$_ - using $string!!!

...

Анатолий Шарифулин

unread,
Aug 23, 2011, 5:06:42 AM8/23/11
to mojol...@googlegroups.com
I fixed this in my fork, but Sebastian ignored




2011/8/23 Ярослав Косьмина <half...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To post to this group, send email to mojol...@googlegroups.com.
To unsubscribe from this group, send email to mojolicious...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mojolicious?hl=en.




--
С уважением,
 Анатолий Шарифулин.

Sebastian Riedel

unread,
Aug 23, 2011, 9:56:54 AM8/23/11
to mojol...@googlegroups.com
I fixed this in my fork, but Sebastian ignored

I'm not ignoring you, you are ignoring me!
Here's the pull request… https://github.com/kraih/mojo/pull/202

-- 
Sebastian Riedel

Анатолий Шарифулин

unread,
Aug 23, 2011, 10:07:43 AM8/23/11
to mojol...@googlegroups.com
Sorry, I haven't tests.
  1. $_ vs. $string — it's typo, no test.

  2. A string may be empty after decode, I don't know any test string for this test suite.

--
You received this message because you are subscribed to the Google Groups "Mojolicious" group.
To post to this group, send email to mojol...@googlegroups.com.
To unsubscribe from this group, send email to mojolicious...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mojolicious?hl=en.

Sebastian Riedel

unread,
Aug 23, 2011, 10:10:50 AM8/23/11
to mojol...@googlegroups.com
Sorry, I haven't tests.
  1. $_ vs. $string — it's typo, no test.

  2. A string may be empty after decode, I don't know any test string for this test suite.

Maybe i didn't make it clear enough, fixing a typo is fine, but you can't add new error messages without tests.
Anyway, the typo has been fixed on GitHub.
Reply all
Reply to author
Forward
0 new messages