Ticket #389: no_methods_in_namespace.2.patch

File no_methods_in_namespace.2.patch, 2.3 KB (added by allison, 12 years ago)
  • src/pmc/namespace.pmc

     
    128128    PMC              * const classobj = VTABLE_get_class(interp, self); 
    129129    STRING           * vtable_key     = STRINGNULL; 
    130130    Parrot_Sub_attributes *sub; 
     131    INTVAL stored = 0; 
    131132 
    132133    PMC_get_sub(interp, value, sub); 
    133134 
     
    152153            /* Insert it. */ 
    153154            VTABLE_set_pmc_keyed_int(interp, vtable, sub->vtable_index, value); 
    154155        } 
     156        if (!(sub->comp_flags & SUB_COMP_FLAG_NSENTRY)) 
     157            stored = 1; 
    155158    } 
    156159 
    157160    if (sub->comp_flags & SUB_COMP_FLAG_METHOD) { 
     
    166169            method_name = sub->method_name; 
    167170        } 
    168171        add_to_class(interp, nsinfo, classobj, method_name, value); 
     172 
     173        if (!(sub->comp_flags & SUB_COMP_FLAG_NSENTRY)) 
     174            stored = 1; 
    169175    } 
    170176 
    171     return 0; 
     177    return stored; 
    172178} 
    173179 
    174180PARROT_WARN_UNUSED_RESULT 
  • ext/nqp-rx/src/stage0/HLL-s0.pir

     
    468468.end 
    469469 
    470470 
    471 .sub 'quotemod_check' :method 
     471.sub 'quotemod_check' :method :nsentry 
    472472    .param string mod 
    473473 
    474474    $P0 = find_dynamic_lex '%*QUOTEMOD' 
  • t/pmc/namespace-subs.t

     
    7373    is($I1, 75, "Invoked stored method") 
    7474 
    7575    $P2 = get_hll_global ['MethodTest'], 'methodtest' 
    76     todo(0, "Method not stored in namespace", "see TT #389") 
    77 #    is_null($P2, "Method not stored in namespace") 
     76    is_null($P2, "Method not stored in namespace") 
    7877.end 
    7978 
    8079.sub 'store_nsentry' 
  • t/compilers/imcc/syn/subflags.t

     
    6969    isa_ok($P30, 'Sub', ":method sub found w/.const") 
    7070    $P0 = get_global 'method1' 
    7171    $I0 = isnull $P0 
    72     todo($I0, ":method sub not found in namespace") 
     72    ok($I0, ":method sub not found in namespace") 
    7373 
    7474    ## :subid subs 
    7575    .const 'Sub' $P40 = 'subid1'