Skip to content

Commit

Permalink
Merge pull request #5 from trinketapp/4-kwargs
Browse files Browse the repository at this point in the history
Checks that keyword arg value is defined. Fixes #4.
  • Loading branch information
eah13 authored Jul 7, 2017
2 parents a15428c + 107db9c commit 557a8db
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 557a8db

Please sign in to comment.