зеркало из https://github.com/mozilla/pjs.git
Allow catch...with statements to not be followed by anything. Also add a little debug code.
This commit is contained in:
Родитель
c55ddb73a7
Коммит
9f44a14e09
|
@ -163,7 +163,8 @@ sub catch($$) {
|
|||
not $continuation->isa('PLIF::Exception::Internal::With')) {
|
||||
syntax 'Syntax error: missing "with" operator in "catch" clause', caller;
|
||||
}
|
||||
syntax 'Syntax error after "catch ... with" clause', caller if (scalar(@more));
|
||||
{ local $" = '\', \'';
|
||||
syntax "Syntax error after \"catch ... with\" clause ('@_'?)", caller if (scalar(@more)); }
|
||||
$continuation->{'resolved'} = 1;
|
||||
my $handler = $continuation->{'handler'};
|
||||
$continuation = $continuation->{'continuation'};
|
||||
|
@ -176,9 +177,9 @@ sub catch($$) {
|
|||
|
||||
sub with(&;$) {
|
||||
my($handler, $continuation) = @_;
|
||||
if (not defined($continuation) or
|
||||
not ref($continuation) or
|
||||
not $continuation->isa('PLIF::Exception::Internal::Continuation')) {
|
||||
if (defined($continuation) and
|
||||
(not ref($continuation) or
|
||||
not $continuation->isa('PLIF::Exception::Internal::Continuation'))) {
|
||||
syntax 'Syntax error after "catch ... with" clause', caller;
|
||||
}
|
||||
return PLIF::Exception::Internal::With->create($handler, $continuation, caller);
|
||||
|
|
Загрузка…
Ссылка в новой задаче