Ticket #1790: temporary_boolean_isa_integer.patch
File temporary_boolean_isa_integer.patch, 1.3 KB (added by NotFound, 11 years ago) |
---|
-
src/pmc/boolean.pmc
184 184 SELF.set_bool(VTABLE_shift_integer(INTERP, info)); 185 185 } 186 186 187 /* 188 189 =item C<INTVAL isa(STRING *name)> 190 191 Temporary solution for backward compatibility until deprecation cycle. 192 193 See TT #1790 194 195 =cut 196 197 */ 198 199 VTABLE INTVAL isa(STRING *some) 200 { 201 if (Parrot_str_equal(INTERP, some, CONST_STRING(INTERP, "Boolean"))) 202 return 1; 203 if (Parrot_str_equal(INTERP, some, CONST_STRING(INTERP, "scalar"))) 204 return 1; 205 if (Parrot_str_equal(INTERP, some, CONST_STRING(INTERP, "Integer"))) 206 return 1; 207 return 0; 208 } 209 187 210 } 188 211 189 212 /* -
t/pmc/boolean.t
19 19 20 20 .sub main :main 21 21 .include 'test_more.pir' 22 plan(3 1)22 plan(32) 23 23 init_null_tests() 24 24 init_int_tests() 25 25 instantiate_tests() … … 207 207 .local int b 208 208 209 209 p = new ['Boolean'] 210 211 isa b, p, "Integer" 212 is(b, 1, "Boolean isa Integer - going to be deprecated - TT #1790") 213 210 214 does b, p, "scalar" 211 215 is(b, 1, "Boolean does scalar") 212 216 does b, p, "boolean"