| 1 | Index: DEPRECATED.pod |
|---|
| 2 | =================================================================== |
|---|
| 3 | --- DEPRECATED.pod (revision 37815) |
|---|
| 4 | +++ DEPRECATED.pod (working copy) |
|---|
| 5 | @@ -112,14 +112,6 @@ |
|---|
| 6 | |
|---|
| 7 | L<http://rt.perl.org/rt3/Ticket/Display.html?id=48014> |
|---|
| 8 | |
|---|
| 9 | -=item :anon and :vtable named parameters to add_method [eligible in 1.1] |
|---|
| 10 | - |
|---|
| 11 | -If you want to override a vtable method/function when building a Class, then |
|---|
| 12 | -use the method C<add_vtable_override> instead of calling C<add_method> with |
|---|
| 13 | -one or both of these flags. |
|---|
| 14 | - |
|---|
| 15 | -L<https://trac.parrot.org/parrot/ticket/158> |
|---|
| 16 | - |
|---|
| 17 | =back |
|---|
| 18 | |
|---|
| 19 | =head1 PIR syntax |
|---|
| 20 | Index: src/pmc/class.pmc |
|---|
| 21 | =================================================================== |
|---|
| 22 | --- src/pmc/class.pmc (revision 37815) |
|---|
| 23 | +++ src/pmc/class.pmc (working copy) |
|---|
| 24 | @@ -1766,19 +1766,9 @@ |
|---|
| 25 | =cut |
|---|
| 26 | |
|---|
| 27 | */ |
|---|
| 28 | - METHOD add_method(STRING *name, PMC *sub, |
|---|
| 29 | - int vtable :optional :named("vtable"), |
|---|
| 30 | - int has_vtable :opt_flag, |
|---|
| 31 | - int anon :optional :named("anon"), |
|---|
| 32 | - int has_anon :opt_flag) |
|---|
| 33 | + METHOD add_method(STRING *name, PMC *sub) |
|---|
| 34 | { |
|---|
| 35 | - /* If it's a vtable method... */ |
|---|
| 36 | - if (has_vtable && vtable) |
|---|
| 37 | - VTABLE_add_vtable_override(interp, SELF, name, sub); |
|---|
| 38 | - |
|---|
| 39 | - /* Provided it's not anonymous, add it to the methods list. */ |
|---|
| 40 | - if (!has_anon || !anon) |
|---|
| 41 | - SELF.add_method(name, sub); |
|---|
| 42 | + SELF.add_method(name, sub); |
|---|
| 43 | } |
|---|
| 44 | |
|---|
| 45 | /* |
|---|
| 46 | Index: t/pmc/pmcproxy.t |
|---|
| 47 | =================================================================== |
|---|
| 48 | --- t/pmc/pmcproxy.t (revision 37815) |
|---|
| 49 | +++ t/pmc/pmcproxy.t (working copy) |
|---|
| 50 | @@ -146,7 +146,7 @@ |
|---|
| 51 | |
|---|
| 52 | #We will override the add_role vtable method. |
|---|
| 53 | $P2 = get_global 'no_add_role' |
|---|
| 54 | - $P0.'add_method'('add_role', $P2, 'vtable' => 1) |
|---|
| 55 | + $P0.'add_vtable_override'('add_role', $P2) |
|---|
| 56 | ok(1, 'overrode a vtable method') |
|---|
| 57 | |
|---|
| 58 | $P2 = $P0.'new'() |
|---|
| 59 | @@ -180,7 +180,7 @@ |
|---|
| 60 | |
|---|
| 61 | #We will override the inspect_str vtable method. |
|---|
| 62 | $P2 = get_global 'always42' |
|---|
| 63 | - $P0.'add_method'('inspect_str', $P2, 'vtable' => 1) |
|---|
| 64 | + $P0.'add_vtable_override'('inspect_str', $P2) |
|---|
| 65 | ok(1, 'overrode inspect_str method') |
|---|
| 66 | |
|---|
| 67 | $P2 = $P0.'new'() |
|---|
| 68 | Index: t/pmc/object-meths.t |
|---|
| 69 | =================================================================== |
|---|
| 70 | --- t/pmc/object-meths.t (revision 37815) |
|---|
| 71 | +++ t/pmc/object-meths.t (working copy) |
|---|
| 72 | @@ -728,7 +728,7 @@ |
|---|
| 73 | o = new ['Bar'] |
|---|
| 74 | print o |
|---|
| 75 | $P0 = get_global "ok2" |
|---|
| 76 | - cl.'add_method'('get_string', $P0, 'vtable' => 1) |
|---|
| 77 | + cl.'add_vtable_override'('get_string', $P0) |
|---|
| 78 | print o |
|---|
| 79 | .end |
|---|
| 80 | .sub ok2 |
|---|