mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 08:45:46 +00:00
Minor bug fixes: Make anonymous arguments start from 1 not 0; make a zero argument response have a response (a true boolean); make outputs with zero or one arguments be handled as outputs instead of implied property accesses.
This commit is contained in:
parent
0e55bf5f1a
commit
2c7166b3af
@ -69,7 +69,7 @@ sub decodeXMLRPC {
|
||||
if (@$values == 1 and $values->[0]->type eq 'struct') {
|
||||
$arguments = $values->[0]->value;
|
||||
} else {
|
||||
my $index = 0;
|
||||
my $index = 1;
|
||||
$arguments = {};
|
||||
foreach my $argument (@$values) {
|
||||
$arguments->{$index++} = $argument->value;
|
||||
@ -115,12 +115,22 @@ sub methodMissing {
|
||||
}
|
||||
if (@arguments > 1) {
|
||||
$response = RPC::XML::response->new(RPC::XML::array->new(@arguments));
|
||||
} else {
|
||||
} elsif (@arguments) {
|
||||
$response = RPC::XML::response->new(@arguments);
|
||||
} else {
|
||||
$response = RPC::XML::response->new(RPC::XML::boolean->new(1)); # XXX
|
||||
}
|
||||
$self->output->XMLRPC($response->as_string);
|
||||
}
|
||||
|
||||
# disable implied property access so that all method calls are routed
|
||||
# through methodMissing() above.
|
||||
sub propertyImpliedAccessAllowed {
|
||||
my $self = shift;
|
||||
my($name) = @_;
|
||||
return ($name eq 'output');
|
||||
}
|
||||
|
||||
# This is commented out because the default generic output module
|
||||
# defaults to this behaviour anyway, and we don't really want this
|
||||
# module being probed for output.generic.dispatcher stuff since it has
|
||||
|
Loading…
Reference in New Issue
Block a user