From: Karen Etheridge Date: Sun, 12 Oct 2014 19:36:46 +0000 (-0700) Subject: swapped out Safe::Isa for Scalar::Util X-Git-Tag: v1.002005~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8e911b7ebf1f3695505eb8386e71f83d901a6d10;p=p5sagit%2FJSON-MaybeXS.git swapped out Safe::Isa for Scalar::Util --- diff --git a/Changes b/Changes index 3ae0239..437646a 100644 --- a/Changes +++ b/Changes @@ -2,6 +2,7 @@ Revision history for JSON-MaybeXS - fix "can I haz XS?" logic precedence in Makefile.PL - added the ':all' export tag + - removed dependency on Safe::Isa 1.002004 - 2014-10-11 - support use of PUREPERL_ONLY in Makefile.PL to avoid adding an XS diff --git a/Makefile.PL b/Makefile.PL index ac6015f..d15050c 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -35,7 +35,7 @@ my %WriteMakefileArgs = ( }, runtime => { requires => { - 'Safe::Isa' => '0', + 'Scalar::Util' => '0', 'JSON::PP' => '2.27202', # we may also add a runtime prereq for Cpanel::JSON::XS, on the # installer's machine diff --git a/lib/JSON/MaybeXS.pm b/lib/JSON/MaybeXS.pm index 7f8d357..ca18815 100644 --- a/lib/JSON/MaybeXS.pm +++ b/lib/JSON/MaybeXS.pm @@ -44,13 +44,14 @@ sub new { return $new; } -use Safe::Isa; +use Scalar::Util (); sub is_bool { die 'is_bool is not a method' if $_[1]; - $_[0]->$_isa('JSON::XS::Boolean') - or $_[0]->$_isa('JSON::PP::Boolean'); + Scalar::Util::blessed($_[0]) + and ($_[0]->isa('JSON::XS::Boolean') + or $_[0]->isa('JSON::PP::Boolean')); } 1;