Skip to content

Commit

Permalink
Checks that keyword arg value is defined. Fixes #4.
Browse files Browse the repository at this point in the history
  • Loading branch information
brianpmarks committed Jul 6, 2017
1 parent a15428c commit 107db9c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions __init__.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,15 @@ var $builtinmodule = function(name) {
});

$loc.render = new Sk.builtin.func(function(self) {
var i, key;
var i, key, val;

for (i = 0; i < KWARGS.length; i++) {
key = KWARGS[i];
self.instance._options[key] = Sk.ffi.remapToJs(self.tp$getattr(key));
val = self.tp$getattr(key);

if (typeof val !== "undefined") {
self.instance._options[key] = Sk.ffi.remapToJs(val);
}
}

return self.instance.render(renderer);
Expand Down

0 comments on commit 107db9c

Please sign in to comment.