Skip to content

Instantly share code, notes, and snippets.

@aseemk
Created September 8, 2011 17:03
Show Gist options
  • Save aseemk/1203929 to your computer and use it in GitHub Desktop.
Save aseemk/1203929 to your computer and use it in GitHub Desktop.
Streamline bug: order of precedence w/ comma operator
thing =
if id = input.id
Thing.getById id, _
else
url = adjustURL input.url
Thing.getByURL url, _
var id, thing, url;
thing = (id = input.id) ? Thing.getById(id, _) : (url = adjustURL(input.url), Thing.getByURL(url, _));
(function main(_) {
var id, thing, url;
var __frame = {
name: "main",
line: 1
};
return __func(_, this, arguments, main, 0, __frame, function __$main() {
return (function __$main(_) {
var __1 = (id = input.id);
return (function __$main(__then) {
if (__1) {
return Thing.getById(id, __cb(_, __frame, 1, 26, _));
}
else {
__then();
}
;
})(function __$main() {
return Thing.getByURL(url, __cb(_, __frame, 1, 78, function ___(__0, __4) {
var __3 = (url = adjustURL(input.url), __4);
return _(null, __3);
}));
});
})(__cb(_, __frame, 7, 6, function ___(__0, __2) {
thing = __2;
_();
}));
});
}).call(this, __trap);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment