Closed JJ closed 1 year ago
hi, can you verify that this is no longer an issue? { 3 => 3 }
isn't valid json map syntax and it already complains as soon as it sees the initial 3 that is not quoted.
I'm afraid this is still an issue with raku 2020.08.2 and the module upgraded to the latest option.
Seems OK with more recent versions:
$ raku -MJSON::Fast -e "say from-json '{ 3 => 3}'"
$ raku --version
Welcome to Rakudo™ v2023.02.
Implementing the Raku® Programming Language v6.d.
$ zef info JSON::Fast | grep Identity
- Identity: JSON::Fast:ver<0.17>:auth<cpan:TIMOTIMO>
i don't think i was able to reproduce the original issue, but it's been a while so i may be misremembering. anyway, as coke points out, this works fine now
⬢[timo@toolbox json_fast]$ raku -MJSON::Fast -e "say from-json '{ 3 => 3}'"
at 2: json requires object keys to be strings
in sub parse-obj at /home/timo/raku/prefix/share/perl6/site/sources/C1DA909DAD9BF713751A74EBF038C545A1EA6ECC (JSON::Fast) line 652
in sub parse-thing at /home/timo/raku/prefix/share/perl6/site/sources/C1DA909DAD9BF713751A74EBF038C545A1EA6ECC (JSON::Fast) line 755
in sub from-json at /home/timo/raku/prefix/share/perl6/site/sources/C1DA909DAD9BF713751A74EBF038C545A1EA6ECC (JSON::Fast) line 911
in block <unit> at -e line 1```
This JSON:
Passes without a problem.
This line of code:
https://github.com/timo/json_fast/blob/master/lib/JSON/Fast.pm6#L562
is not reached, and I think it's not tested either.