Skip to content

Commit

Permalink
Merge pull request #1 from jlaurens/jlaurens-patch-1
Browse files Browse the repository at this point in the history
Added a test for possibly undefined argument
  • Loading branch information
jlaurens authored Jan 19, 2019
2 parents f2768f1 + ac07310 commit 2a3f18c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions www/src/js_objects.js
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ JSObject.__getattribute__ = function(self,attr){
var res = function(){
var args = []
for(var i = 0, len = arguments.length; i < len; i++){
if(arguments[i] !== null && arguments[i].$nat !== undefined){
var arg = arguments[i]
if(arg !== undefined && arg !== null && arg.$nat !== undefined){
//
// Passing keyword arguments to a Javascript function
// raises a TypeError : since we don't know the
Expand All @@ -266,7 +267,7 @@ JSObject.__getattribute__ = function(self,attr){
"A Javascript function can't take " +
"keyword arguments")
}else{
args.push(pyobj2jsobj(arguments[i]))
args.push(pyobj2jsobj(arg))
}
}
// IE workaround
Expand Down

0 comments on commit 2a3f18c

Please sign in to comment.