Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

closure lesson fix for returning on the same line as zip() declaration #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions exercises/closures/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,23 @@ module.exports = {

scopeAsAscii = asciiScope(code);

t.equal(
scopeAsAscii,
['(global)','\tfoo()','\t- var bar','\t- quux = ?','\treturn zip','\t\tzip()','\t\t- var quux', '\t\t- bar = ?'].join('\n'),
'The structure is correct'
);
if (scopeAsAscii.match(/return/)){
t.equal(
scopeAsAscii,
['(global)','\tfoo()','\t- var bar','\t- quux = ?','\treturn zip','\t\tzip()','\t\t- var quux', '\t\t- bar = ?'].join('\n'),
'The structure is correct'
);
} else {
t.equal(
scopeAsAscii,
['(global)','\tfoo()','\t- var bar','\t- quux = ?','\t\tzip()','\t\t- var quux', '\t\t- bar = ?'].join('\n'),
'The structure is correct'
);
}

t.end();

});

})
}
}