[FIX] py.js: arguments dispatching in PY_call

When providing an args of ``null`` (or ``undefined``) and a non-empty
kwargs, the kwargs would be removed/ignored.

While explicitly providing a null args is not necessary, it's perfectly
valid.
This commit is contained in:
Xavier Morel 2015-03-03 11:51:50 +01:00
parent eb9c8912a9
commit 752e21a633
1 changed files with 5 additions and 3 deletions

View File

@ -547,11 +547,13 @@ var py = {};
};
py.PY_call = function (callable, args, kwargs) {
if (!args) {
args = []; kwargs = {};
} else if (typeof args === 'object' && !(args instanceof Array)) {
args = [];
}
if (typeof args === 'object' && !(args instanceof Array)) {
kwargs = args;
args = [];
} else if (!kwargs) {
}
if (!kwargs) {
kwargs = {};
}
if (callable.__is_type) {