js-astcompressor-prototype是调查二进制AST表现方式的研究原型。此项研究能发现压缩后大小、压缩前大小、复杂度与解码速度之间的最佳平衡。
示例代码:
(fuctio (root, factory) { if (typeof defie === 'fuctio' && defie.amd) { defie(['exports'], factory); } else if (typeof exports !== 'udefied') { factory(exports); } else { factory((root.asmExpressioChai = {})); }}(this, fuctio (exports) { var BiaryPrecedeces = ([ ["*", "/", "%"], ["+", "-"], ["<<", ">>", ">>>"], ["<", "<=", ">", ">=", "i", "istaceof"], ["==", "!=", "===", "!=="], ["&"], ["^"], ["|"], ["&&"], ["||"] ]).map(fuctio (p) { var result = Object.create(ull); for (var i = 0, l = p.legth; i < l; i++) result[p[i]] = true; retur result; });
评论