We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If I compile this with the latest version of CoffeeScript:
Array.isArray ?= (object) -> Object.prototype.toString.call(object) is '[object Array]'
I get this:
var _ref; if ((_ref = Array.isArray) == null) { Array.isArray = function(object) { return Object.prototype.toString.call(object) === '[object Array]'; }; }
Which has an extra _ref variable that is never used. Probably should just simplify that to:
_ref
if (Array.isArray == null) { Array.isArray = function(object) { return Object.prototype.toString.call(object) === '[object Array]'; }; }
The text was updated successfully, but these errors were encountered:
Confirmed. Minimal test case: a.b ?= c
a.b ?= c
var _ref; if ((_ref = a.b) == null) a.b = c;
edit: To whoever works on this: be careful because _ref is used when the result of the existential assignment is used:
$ coffee -bep 'a = (b.c ?= d)' var a, _ref; a = ((_ref = b.c) != null ? _ref : b.c = d);
Sorry, something went wrong.
fac6151
The above commit should fix this case -- where the existential assignment occurs at the top level, we know that there's no need to cache the ref.
This reoccurs in current master, is there a reason the commit got revoked?
@jashkenas : This issue appears to be related!
#2197
There is a fix in there that causes this "useless" _ref variable to reappear. Is there a way to fix both issues?
No branches or pull requests
If I compile this with the latest version of CoffeeScript:
I get this:
Which has an extra
_ref
variable that is never used. Probably should just simplify that to:The text was updated successfully, but these errors were encountered: