const VS features detection

François REMY at
Wed Jan 8 09:35:52 PST 2014

Please note that you do not really create a one-shot function and garbage in this case, at least if the compiler does his job well. The F# compiler, and probably many functional language compilers, would correctly inline the lambda function here. 


There’s probably no reason a JavaScript compiler couldn’t do the same here (and if this becomes a very used pattern, there will be traction to make sure this works well).



Still bugs me by design we need to create garbage, including one-shot functions, in order to inline a try/catch to assign to a single "pointer"



const ES6_PROXY = ()=>{

  try {

    new Proxy({},{});

    return true;

  } catch(o_O) {

    return false;





-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list