commit 88efcb49c8017dad00b17a535ec545206ca47eca
Author: Vasily Chekalkin <bacek@bacek.com>
Date: Mon May 25 01:46:41 2009 +1000
[core] Store anonimous subs in namespace and filter them out in
find_globa.
This allows class.pmc to find them, but no one else will do.
diff --git a/compilers/imcc/pbc.c b/compilers/imcc/pbc.c
index 098f27c..c30174c 100644
|
a
|
b
|
|
| 1482 | 1482 | } |
| 1483 | 1483 | else |
| 1484 | 1484 | sub->method_name = sub->name; |
| | 1485 | sub_pmc->flags |= SUB_FLAG_PF_ANON; |
| 1485 | 1486 | } |
| 1486 | 1487 | else |
| 1487 | 1488 | sub->method_name = Parrot_str_new(interp, "", 0); |
diff --git a/src/global.c b/src/global.c
index c32c2b5..13c62de 100644
|
a
|
b
|
|
| 549 | 549 | */ |
| 550 | 550 | res = (PMC *)VTABLE_get_pointer_keyed_str(interp, ns, globalname); |
| 551 | 551 | } |
| | 552 | |
| | 553 | if (PMC_IS_NULL(res)) |
| | 554 | return NULL; |
| 552 | 555 | |
| 553 | | return PMC_IS_NULL(res) ? NULL : res; |
| | 556 | if (PObj_get_FLAGS(res) & SUB_FLAG_PF_ANON) |
| | 557 | return NULL; |
| | 558 | |
| | 559 | return res; |
| 554 | 560 | } |
| 555 | 561 | |
| 556 | 562 | /* |
| … |
… |
|
| 878 | 884 | if (!PMC_IS_NULL(sub->multi_signature)) |
| 879 | 885 | store_sub_in_multi(interp, sub_pmc, ns); |
| 880 | 886 | |
| 881 | | /* store other subs (as long as they're not :anon) */ |
| 882 | | else if (!(PObj_get_FLAGS(sub_pmc) & SUB_FLAG_PF_ANON)) { |
| | 887 | /* store other subs */ |
| | 888 | else { |
| 883 | 889 | STRING * const ns_entry_name = sub->ns_entry_name; |
| 884 | 890 | PMC * const nsname = sub->namespace_name; |
| 885 | 891 | |