Skip to content

Commit

Permalink
Fixing function return bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Grant committed Nov 22, 2019
1 parent f4525e4 commit 5d5d663
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
8 changes: 7 additions & 1 deletion docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,13 @@ var assert,
body,
test;

assert = (message, actual, expected) => [actual == expected, actual, expected, message];
assert = (message, actual, expected) => {
expected = typeof(expected) == "object" ? JSON.stringify(expected) : expected;
actual = typeof(actual) == "object" ? JSON.stringify(actual) : actual;

return [actual == expected, actual, expected, message];
}

test = (term, assertions, sandbox) => {
if (sandbox) {
document.getElementById("test-sandbox").innerHTML = sandbox;
Expand Down
4 changes: 2 additions & 2 deletions mozart.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ class Mozart {
acts(obj) {
var public_obj = this.parse_object(obj.priv, (obj, args, key) => {
var _$ = this.scoped_selector();
obj[key](_$, args);
return obj[key](_$, args);
});

this.add_object_method("act", public_obj, true);
this.add_object_method("acts", public_obj, true);

var private_obj = this.parse_object(obj, (obj, args, key) => {
var _$ = this.scoped_selector();
obj[key](_$, args);
return obj[key](_$, args);
});

this.add_object_method("act", private_obj);
Expand Down

0 comments on commit 5d5d663

Please sign in to comment.