From 752e21a633be22e30cb8ff9d63ad2ee656ff6b71 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 3 Mar 2015 11:51:50 +0100 Subject: [PATCH] [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. --- addons/web/static/lib/py.js/lib/py.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/addons/web/static/lib/py.js/lib/py.js b/addons/web/static/lib/py.js/lib/py.js index 2c738dc95d1..ed5657c8f3b 100644 --- a/addons/web/static/lib/py.js/lib/py.js +++ b/addons/web/static/lib/py.js/lib/py.js @@ -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) {