rurban / Cpanel-JSON-XS

Improved fork of JSON-XS

Home Page:http://search.cpan.org/dist/Cpanel-JSON-XS/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

is_bool() should recognize unblessed_bool booleans

karenetheridge opened this issue · comments

is_bool() should check for the values &PL_sv_yes and &PL_sv_no, which is what is produced when decoding booleans when unblessed_bools is set.

In pure perl this can be done with sub isbool { return 1 if <other checks> || \$_[0] == \!!0 || \$_[0] == \!!1 } -- I expect the XS equivalent is just comparing to &PL_sv_yes directly.

oh perhaps not, given #121

Exactly. We need non-readonly copies

But we should add support to detect such new booleans, of course.

Such support added with PR #198 via CORE_BOOL