Closed
Description
If judgment condition has the scenario of assigning values to variables, short circuit logic should not be used to splice the executors in if judgment.
Before compress
const r = [[Array(), Array()], [Array(), Array()]];
function test(e) {
this.uid = 1;
var n, o, a, c = {}, l = !0;
if (-1 !== e.indexOf("::") ? function (t) {
n = t[0], e = t[1]
}(e.split("::")) : n = this.uid, e = e.toLowerCase(), o = r[n] && r[n][e]) {
o.sort(function (e, t) {
return t.priority - e.priority
}), a = [].slice.call(arguments), a.shift(), c.type = e, a.unshift(c);
}
return [o, a, c, l];
}
console.log(test("1::1"));
After compress
const r=[[Array(),Array()],[Array(),Array()]];function test(e){this.uid=1;var n,o,a,c={},l=!0;return-1!==e.indexOf("::")?function(t){n=t[0],e=t[1]}(e.split("::")):n=this.uid,e=e.toLowerCase(),o=r[n]&&r[n][e]&&(o.sort(function(e,t){return t.priority-e.priority}),a=[].slice.call(arguments),a.shift(),c.type=e,a.unshift(c)),[o,a,c,l]}console.log(test("1::1"))
Uncaught TypeError: Cannot read property 'sort' of undefined
at test (in.js:1)
at in.js:1
Metadata
Metadata
Assignees
Labels
No labels