зеркало из https://github.com/mozilla/pjs.git
Remove bogus argument, and add error checking code to catch similar errors in future
This commit is contained in:
Родитель
3de5e5c389
Коммит
25d42a3e3d
|
@ -125,9 +125,10 @@ sub create {
|
|||
}
|
||||
|
||||
sub init {
|
||||
my($exception, $method, @data) = @_;
|
||||
my($exception, @data) = @_;
|
||||
if (not ref($exception)) {
|
||||
# in case we were called as a constructor
|
||||
syntaxError 'odd number of elements passed to exception constructor', 1 if @data % 2;
|
||||
$exception = $exception->create(@data);
|
||||
}
|
||||
# set up the exception and return it
|
||||
|
|
Загрузка…
Ссылка в новой задаче