Jacob Parker schrieb:
Either I'm wrong, or that's missing some parens. Assume the following (the
only interpretation I can see to not throw a syntax error),

     var y = (function (a) a ? f : x++)(1);

In which case, that could only return `f`, which when printed should print
the source of f, no?

Uh, I had some problems with that either, but finally got it now. If we make the parens explicit, the point is that the expression should be evaluated as

  var y = ((function (a) a) ? f : x++)(1); // === f(1)

instead of

  var y = (function (a) (a ? f : x++))(1); // === f

Admittedly, I think arrow functions have same problem. How is

  var y = (a) => a ? f : x++ (1);

evaluated (or is it syntactically valid at all)?

 Bergi

_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to