var scope = request.scope || dojo.global; if(items.length){ request.oldOnItem.call(scope, items[0]); }else{ request.oldOnItem.call(scope, null); }