The structure of the JavaScript is interesting. It looks like this:
if(typeof Math.imul == "undefined" || (Math.imul(0xffffffff,5) == 0)) {
Math.imul = function (a, b) {
var ah = (a >>> 16) & 0xffff;
var al = a & 0xffff;
var bh = (b >>> 16) & 0xffff;
var bl = b & 0xffff;
// the shift by 0 fixes the sign on the high part
// the final |0 converts the unsigned value into a signed value
return ((al * bl) + (((ah * bl + al * bh) << 16) >>> 0)|0);
}
}
[240k of minimized JavaScript
generated by ClojureScript]
The non-minimized code is just a copy/paste of the imul polyfill [1] from MDN. I'm curious why that is needed, since the ClojureScript seems to already have an imul polyfill included (the function named Ed in the minimized code). Is ClojureScript's polyfill broken?[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...