Skip to content

Commit

Permalink
Make LibXML::Item use :config for boxing (#97)
Browse files Browse the repository at this point in the history
Any config supplied by upstream was previously ignored and class mapping
was expected to be done by `LibXML::Node`. This resulted in limited
abilities of user code in controlling how boxing is done. See #94.

Note that `LibXML::Node` still does its own class mapping because this
is the point of final decision and in many cases it is invoked directly.
  • Loading branch information
vrurg authored Feb 27, 2023
1 parent e14ebd7 commit fb25e54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/LibXML/Item.rakumod
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ multi method box-class(::?CLASS:D: Int:D $id) { $!config.class-from($id) }

proto method box(|) {*}
# XXX Should it be `anyNode:D` instead of `Any:D`??
multi method box(::?CLASS:D: Any:D $_, *%c) { $.config.class-from(.type).box(.delegate, :$!config, |%c) }
multi method box(::?CLASS:U: Any:D $_, *%c) { $.config.class-from(.type).box(.delegate, |%c) }
multi method box(::?CLASS:D: Any:D $_, *%c) { (%c<config> //= $.config).class-from(.type).box(.delegate, |%c) }
multi method box(::?CLASS:U: Any:D $_, *%c) { (%c<config> // $.config).class-from(.type).box(.delegate, |%c) }
multi method box(Any:U) { self.WHAT }

#| Node constructor from data
Expand Down

0 comments on commit fb25e54

Please sign in to comment.