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
$ coffee --no-wrap -pe 'x[++i][++i][++i] ||= 1' var _ref, _ref2, _ref3; x[(_ref = ++i)][(_ref2 = ++i)][(_ref3 = ++i)] || (x[_ref][_ref2][_ref3] = 1);
This shouldn't need more than two temporary variables. The better way is: var _ref, _ref2; (_ref = x[++i][++i])[_ref2 = ++i] || (_ref[_ref2] = 1); Also this: $ coffee --no-wrap -pe 'x[++i] ?= 1' var _ref; x[(_ref = ++i)] = (typeof x[_ref] !== "undefined" && x[_ref] !== null) ? x[_ref] : 1; should be: var _ref, _ref2; (_ref = x[_ref2 = ++i]) == null ? x[_ref2] = 1 : _ref; And this: $ coffee --no-wrap -pe 'a.b?.c||=1' (a.b == null ? undefined : a.b.c) || (a.b == null ? undefined : a.b.c = 1); should be: (_ref = a.b) == null ? undefined : _ref.c || (_ref.c = 1) Then this (which isn't even correct): $ coffee --no-wrap -pe 'a.b?.c?()' var _ref, _ref2, _ref3; (typeof (typeof (_ref3 = ((_ref2 = (_ref = a.b)))) === "undefined" || _ref3 === null) ? undefined : _ref3.c === "function" ? _ref == null ? undefined : _ref.c() : undefined); should be: var _ref; (_ref = a.b) == null ? undefined : typeof _ref.c !== "function" ? undefined : _ref.c() (hmm, aren't they horrible...)
Patch to come.
The text was updated successfully, but these errors were encountered:
http://github.com/satyr/coffee-script/tree/733
ValueNode with soak now delegates its compilation to IfNode by turning a?.b into if a? then a.b. Similarly, a ?= b now delegates to a ? a = b.
a?.b
if a? then a.b
a ?= b
a ? a = b
Sorry, something went wrong.
No branches or pull requests
This shouldn't need more than two temporary variables. The better way is:
var _ref, _ref2;
(_ref = x[++i][++i])[_ref2 = ++i] || (_ref[_ref2] = 1);
Also this:
$ coffee --no-wrap -pe 'x[++i] ?= 1'
var _ref;
x[(_ref = ++i)] = (typeof x[_ref] !== "undefined" && x[_ref] !== null) ? x[_ref] : 1;
should be:
var _ref, _ref2;
(_ref = x[_ref2 = ++i]) == null ? x[_ref2] = 1 : _ref;
And this:
$ coffee --no-wrap -pe 'a.b?.c||=1'
(a.b == null ? undefined : a.b.c) || (a.b == null ? undefined : a.b.c = 1);
should be:
(_ref = a.b) == null ? undefined : _ref.c || (_ref.c = 1)
Then this (which isn't even correct):
$ coffee --no-wrap -pe 'a.b?.c?()'
var _ref, _ref2, _ref3;
(typeof (typeof (_ref3 = ((_ref2 = (_ref = a.b)))) === "undefined" || _ref3 === null) ? undefined : _ref3.c === "function" ? _ref == null ? undefined : _ref.c() : undefined);
should be:
var _ref;
(_ref = a.b) == null ? undefined : typeof _ref.c !== "function" ? undefined : _ref.c()
(hmm, aren't they horrible...)
Patch to come.
The text was updated successfully, but these errors were encountered: