RReverser
2015-06-17
As far as I understand from spec, set of allowed node types is pretty limited in asm.js.
However, some ES6 features would be useful inside of asm.js code as well, for example:
-
destructuring as a way to import things:
var { exp, log } = stdlib.Math.exp;
-
constants for even better code optimization (direct replacement with numeric value):
const ANSWER = 42;
-
defaults as an alternative way to specify parameter types (following same semantics as for vars in section 5.4) + arrow functions purely for syntax:
const geometricMean = (start = 0, end = 0) => +exp(+logSum(start, end) / +((end - start)|0)); }
-
concise property syntax for exports:
return { geometricMean };
-
(and probably others)