Skip to content

Instantly share code, notes, and snippets.

@GauthamBanasandra
Last active July 6, 2017 06:19
Show Gist options
  • Save GauthamBanasandra/03b9b7dcf963e8dce604b0b96d319cb6 to your computer and use it in GitHub Desktop.
Save GauthamBanasandra/03b9b7dcf963e8dce604b0b96d319cb6 to your computer and use it in GitHub Desktop.
Change in maintaining exit status.
// User code
function query() {
for (var r of res) {
return r;
}
}
function query() {
if (res.isInstance) {
res.x = res.iter(function (r) {
return res.stopIter({
'code': 'return',
'args': '(r)',
'data': r
});
});
switch (res.x.code + res.x.args) {
case 'return(r)':
return res.x.data;;
}
} else {
for (var r of res) {
return r;
}
}
}
function query() {
if (res.isInstance) {
res.iter(function (r) {
return res.stopIter({
'code': 'return',
'args': '(r)',
'data': r
});
});
switch (res.getReturnValue(true)) {
case 'return(r)':
return res.getReturnValue().data;;
}
} else {
for (var r of res) {
return r;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment