This project is read-only.
3
Vote

lodash >3.7.0 fails to minify

description

This is the response i get in chrome dev tools .
/* Minification failed. Returning unminified contents.
(19,462-469): run-time error JS1019: Can't have 'break' outside of loop: break n
 */
/**
 * @license
 * lodash 3.7.0 (Custom Build) lodash.com/license | Underscore.js 1.8.3 underscorejs.org/LICENSE
 * Build: `lodash modern -o ./lodash.js`
 */
;(function(){function n(n,t){if(n!==t){var r=n===n,e=t===t;if(n>t||!r||n===w&&e)return 1;if(n<t||!e||t===w&&r)return-1}return 0}function t(n,t,r){for(var e=n.length,u=r?e:-1;r?u--:++u<e;)if(t(n[u],u,n))return u;return-1}function r(n,t,r){if(t!==t)return p(n,r);r-=1;for(var e=n.length;++r<e;)if(n[r]===t)return r;return-1}function e(n){return typeof n=="function"||false}function u(n){return typeof n=="string"?n:null==n?"":n+""}function o(n){return n.charCodeAt(0)}function i(n,t){for(var r=-1,e=n.length;++r<e&&-1<t.indexOf(n.charAt(r)););
return r}function f(n,t){for(var r=n.length;r--&&-1<t.indexOf(n.charAt(r)););return r}function a(t,r){return n(t.a,r.a)||t.b-r.b}function c(n){return $n[n]}function l(n){return Ln[n]}function s(n){return"\\"+Mn[n]}function p(n,t,r){var e=n.length;for(t+=r?0:-1;r?t--:++t<e;){var u=n[t];if(u!==u)return t}return-1}function h(n){return!!n&&typeof n=="object"}function _(n){return 160>=n&&9<=n&&13>=n||32==n||160==n||5760==n||6158==n||8192<=n&&(8202>=n||8232==n||8233==n||8239==n||8287==n||12288==n||65279==n);

}function v(n,t){for(var r=-1,e=n.length,u=-1,o=[];++r<e;)n[r]===t&&(n[r]=B,o[++u]=r);return o}function g(n){for(var t=-1,r=n.length;++t<r&&_(n.charCodeAt(t)););return t}function y(n){for(var t=n.length;t--&&_(n.charCodeAt(t)););return t}function d(n){return Bn[n]}function m(_){function $n(n){if(h(n)&&!(Io(n)||n instanceof zn)){if(n instanceof Bn)return n;if(Ke.call(n,"__chain__")&&Ke.call(n,"__wrapped__"))return Fr(n)}return new Bn(n)}function Ln(){}function Bn(n,t,r){this.__wrapped__=n,this.__actions__=r||[],
this.__chain__=!!t}function zn(n){this.__wrapped__=n,this.__actions__=null,this.__dir__=1,this.__filtered__=false,this.__iteratees__=null,this.__takeCount__=ju,this.__views__=null}function Mn(){this.__data__={}}function Dn(n){var t=n?n.length:0;for(this.data={hash:_u(null),set:new iu};t--;)this.push(n[t])}function Pn(n,t){var r=n.data;return(typeof t=="string"||ae(t)?r.set.has(t):r.hash[t])?0:-1}function qn(n,t){var r=-1,e=n.length;for(t||(t=Ce(e));++r<e;)t[r]=n[r];return t}function Kn(n,t){for(var r=-1,e=n.length;++r<e&&false!==t(n[r],r,n););
return n}function Vn(n,t){for(var r=-1,e=n.length;++r<e;)if(!t(n[r],r,n))return false;return true}function Gn(n,t){for(var r=-1,e=n.length,u=-1,o=[];++r<e;){var i=n[r];t(i,r,n)&&(o[++u]=i)}return o}function Jn(n,t){for(var r=-1,e=n.length,u=Ce(e);++r<e;)u[r]=t(n[r],r,n);return u}function Xn(n){for(var t=-1,r=n.length,e=Au;++t<r;){var u=n[t];u>e&&(e=u)}return e}function Hn(n,t){for(var r=-1,e=n.length;++r<e;)if(t(n[r],r,n))return true;return false}function Qn(n,t){return n===w?t:n}function nt(n,t,r,e){return n!==w&&Ke.call(e,r)?n:t;

}function tt(n,t,r){var e=zo(t);eu.apply(e,qu(t));for(var u=-1,o=e.length;++u<o;){var i=e[u],f=n[i],a=r(f,t[i],i,n,t);(a===a?a===f:f!==f)&&(f!==w||i in n)||(n[i]=a)}return n}function rt(n,t){for(var r=-1,e=n.length,u=Er(e),o=t.length,i=Ce(o);++r<o;){var f=t[r];i[r]=u?Ar(f,e)?n[f]:w:n[f]}return i}function et(n,t,r){r||(r={});for(var e=-1,u=t.length;++e<u;){var o=t[e];r[o]=n[o]}return r}function ut(n,t,r){var e=typeof n;return"function"==e?t===w?n:Bt(n,t,r):null==n?Oe:"object"==e?wt(n):t===w?Re(n):bt(n,t);

}function ot(n,t,r,e,u,o,i){var f;if(r&&(f=u?r(n,e,u):r(n)),f!==w)return f;if(!ae(n))return n;if(e=Io(n)){if(f=mr(n),!t)return qn(n,f)}else{var a=Ye.call(n),c=a==K;if(a!=Y&&a!=z&&(!c||u))return Nn[a]?br(n,a,t):u?n:{};if(f=wr(c?{}:n),!t)return Tu(f,n)}for(o||(o=[]),i||(i=[]),u=o.length;u--;)if(o[u]==n)return i[u];return o.push(n),i.push(f),(e?Kn:ht)(n,function(e,u){f[u]=ot(e,t,r,u,n,o,i)}),f}function it(n,t,r){if(typeof n!="function")throw new Be(L);return fu(function(){n.apply(w,r)},t)}function ft(n,t){
var e=n?n.length:0,u=[];if(!e)return u;var o=-1,i=dr(),f=i==r,a=f&&200<=t.length?zu(t):null,c=t.length;a&&(i=Pn,f=false,t=a);n:for(;++o<e;)if(a=n[o],f&&a===a){for(var l=c;l--;)if(t[l]===a)continue n;u.push(a)}else 0>i(t,a,0)&&u.push(a);return u}function at(n,t){var r=true;return Nu(n,function(n,e,u){return r=!!t(n,e,u)}),r}function ct(n,t){var r=[];return Nu(n,function(n,e,u){t(n,e,u)&&r.push(n)}),r}function lt(n,t,r,e){var u;return r(n,function(n,r,o){return t(n,r,o)?(u=e?r:n,false):void 0}),u}function st(n,t,r){
for(var e=-1,u=n.length,o=-1,i=[];++e<u;){var f=n[e];if(h(f)&&Er(f.length)&&(Io(f)||oe(f))){t&&(f=st(f,t,r));var a=-1,c=f.length;for(i.length+=c;++a<c;)i[++o]=f[a]}else r||(i[++o]=f)}return i}function pt(n,t){$u(n,t,ge)}function ht(n,t){return $u(n,t,zo)}function _t(n,t){return Lu(n,t,zo)}function vt(n,t){for(var r=-1,e=t.length,u=-1,o=[];++r<e;){var i=t[r];Co(n[i])&&(o[++u]=i)}return o}function gt(n,t,r){if(null!=n){r!==w&&r in Ur(n)&&(t=[r]),r=-1;for(var e=t.length;null!=n&&++r<e;)var u=n=n[t[r]];

return u}}function yt(n,t,r,e,u,o){if(n===t)return 0!==n||1/n==1/t;var i=typeof n,f=typeof t;if("function"!=i&&"object"!=i&&"function"!=f&&"object"!=f||null==n||null==t)n=n!==n&&t!==t;else n:{var i=yt,f=Io(n),a=Io(t),c=M,l=M;f||(c=Ye.call(n),c==z?c=Y:c!=Y&&(f=he(n))),a||(l=Ye.call(t),l==z?l=Y:l!=Y&&he(t));var s=c==Y,a=l==Y,l=c==l;if(!l||f||s){if(!e&&(c=s&&Ke.call(n,"__wrapped__"),a=a&&Ke.call(t,"__wrapped__"),c||a)){n=i(c?n.value():n,a?t.value():t,r,e,u,o);break n}if(l){for(u||(u=[]),o||(o=[]),c=u.length;c--;)if(u[c]==n){
n=o[c]==t;break n}u.push(n),o.push(t),n=(f?hr:vr)(n,t,i,r,e,u,o),u.pop(),o.pop()}else n=false}else n=_r(n,t,c)}return n}function dt(n,t,r,e,u){for(var o=-1,i=t.length,f=!u;++o<i;)if(f&&e[o]?r[o]!==n[t[o]]:!(t[o]in n))return false;for(o=-1;++o<i;){var a=t[o],c=n[a],l=r[o];if(f&&e[o]?a=c!==w||a in n:(a=u?u(c,l,a):w,a===w&&(a=yt(l,c,u,true))),!a)return false}return true}function mt(n,t){var r=-1,e=Pu(n),u=Er(e)?Ce(e):[];return Nu(n,function(n,e,o){u[++r]=t(n,e,o)}),u}function wt(n){var t=zo(n),r=t.length;if(!r)return ke(true);

if(1==r){var e=t[0],u=n[e];if(Ir(u))return function(n){return null==n?false:n[e]===u&&(u!==w||e in Ur(n))}}for(var o=Ce(r),i=Ce(r);r--;)u=n[t[r]],o[r]=u,i[r]=Ir(u);return function(n){return null!=n&&dt(Ur(n),t,o,i)}}function bt(n,t){var r=Io(n),e=kr(n)&&Ir(t),u=n+"";return n=Nr(n),function(o){if(null==o)return false;var i=u;if(o=Ur(o),!(!r&&e||i in o)){if(o=1==n.length?o:gt(o,It(n,0,-1)),null==o)return false;i=Mr(n),o=Ur(o)}return o[i]===t?t!==w||i in o:yt(t,o[i],null,true)}}function xt(n,t,r,e,u){if(!ae(n))return n;

var o=Er(t.length)&&(Io(t)||he(t));if(!o){var i=zo(t);eu.apply(i,qu(t))}return Kn(i||t,function(f,a){if(i&&(a=f,f=t[a]),h(f)){e||(e=[]),u||(u=[]);n:{for(var c=a,l=e,s=u,p=l.length,_=t[c];p--;)if(l[p]==_){n[c]=s[p];break n}var p=n[c],v=r?r(p,_,c,n,t):w,g=v===w;g&&(v=_,Er(_.length)&&(Io(_)||he(_))?v=Io(p)?p:Pu(p)?qn(p):[]:So(_)||oe(_)?v=oe(p)?_e(p):So(p)?p:{}:g=false),l.push(_),s.push(v),g?n[c]=xt(v,_,r,l,s):(v===v?v!==p:p===p)&&(n[c]=v)}}else c=n[a],l=r?r(c,f,a,n,t):w,(s=l===w)&&(l=f),!o&&l===w||!s&&(l===l?l===c:c!==c)||(n[a]=l);

}),n}function At(n){return function(t){return null==t?w:t[n]}}function jt(n){var t=n+"";return n=Nr(n),function(r){return gt(r,n,t)}}function kt(n,t){for(var r=t.length;r--;){var e=parseFloat(t[r]);if(e!=u&&Ar(e)){var u=e;au.call(n,e,1)}}}function Ot(n,t){return n+nu(xu()*(t-n+1))}function Et(n,t,r,e,u){return u(n,function(n,u,o){r=e?(e=false,n):t(r,n,u,o)}),r}function It(n,t,r){var e=-1,u=n.length;for(t=null==t?0:+t||0,0>t&&(t=-t>u?0:u+t),r=r===w||r>u?u:+r||0,0>r&&(r+=u),u=t>r?0:r-t>>>0,t>>>=0,r=Ce(u);++e<u;)r[e]=n[e+t];

return r}function Rt(n,t){var r;return Nu(n,function(n,e,u){return r=t(n,e,u),!r}),!!r}function Ct(n,t){var r=n.length;for(n.sort(t);r--;)n[r]=n[r].c;return n}function St(t,r,e){var u=yr(),o=-1;return r=Jn(r,function(n){return u(n)}),t=mt(t,function(n){return{a:Jn(r,function(t){return t(n)}),b:++o,c:n}}),Ct(t,function(t,r){var u;n:{u=-1;for(var o=t.a,i=r.a,f=o.length,a=e.length;++u<f;){var c=n(o[u],i[u]);if(c){u=u<a?c*(e[u]?1:-1):c;break n}}u=t.b-r.b}return u})}function Wt(n,t){var r=0;return Nu(n,function(n,e,u){
r+=+t(n,e,u)||0}),r}function Tt(n,t){var e=-1,u=dr(),o=n.length,i=u==r,f=i&&200<=o,a=f?zu():null,c=[];a?(u=Pn,i=false):(f=false,a=t?[]:c);n:for(;++e<o;){var l=n[e],s=t?t(l,e,n):l;if(i&&l===l){for(var p=a.length;p--;)if(a[p]===s)continue n;t&&a.push(s),c.push(l)}else 0>u(a,s,0)&&((t||f)&&a.push(s),c.push(l))}return c}function Ut(n,t){for(var r=-1,e=t.length,u=Ce(e);++r<e;)u[r]=n[t[r]];return u}function Nt(n,t,r,e){for(var u=n.length,o=e?u:-1;(e?o--:++o<u)&&t(n[o],o,n););return r?It(n,e?0:o,e?o+1:u):It(n,e?o+1:0,e?u:o);

}function Ft(n,t){var r=n;r instanceof zn&&(r=r.value());for(var e=-1,u=t.length;++e<u;){var r=[r],o=t[e];eu.apply(r,o.args),r=o.func.apply(o.thisArg,r)}return r}function $t(n,t,r){var e=0,u=n?n.length:e;if(typeof t=="number"&&t===t&&u<=Eu){for(;e<u;){var o=e+u>>>1,i=n[o];(r?i<=t:i<t)?e=o+1:u=o}return u}return Lt(n,t,Oe,r)}function Lt(n,t,r,e){t=r(t);for(var u=0,o=n?n.length:0,i=t!==t,f=t===w;u<o;){var a=nu((u+o)/2),c=r(n[a]),l=c===c;(i?l||e:f?l&&(e||c!==w):e?c<=t:c<t)?u=a+1:o=a}return du(o,Ou)}function Bt(n,t,r){
if(typeof n!="function")return Oe;if(t===w)return n;switch(r){case 1:return function(r){return n.call(t,r)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,o){return n.call(t,r,e,u,o)};case 5:return function(r,e,u,o,i){return n.call(t,r,e,u,o,i)}}return function(){return n.apply(t,arguments)}}function zt(n){return Xe.call(n,0)}function Mt(n,t,r){for(var e=r.length,u=-1,o=yu(n.length-e,0),i=-1,f=t.length,a=Ce(o+f);++i<f;)a[i]=t[i];for(;++u<e;)a[r[u]]=n[u];for(;o--;)a[i++]=n[u++];

comments

fdelaporte wrote May 9, 2016 at 2:56 PM

Same issue with Kendo.
See here http://www.telerik.com/forums/mvc-bundling-minification-failure-for-kendo-js-css
It looks like web optimization does not support labeled breaks, though they are standard since ECMAScript 3rd Edition.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/break

Mek7 wrote Nov 24, 2016 at 7:44 AM

Same problem with AngularJS. The original issue was reported a long time ago, is it even going to be fixed?

fdelaporte wrote Nov 24, 2016 at 8:49 AM

Personally I do not count on it anymore. Developments have moved on github. Maybe the "Core" version will fix it.
The main hurdle seems to be this library relies on a JScript parser for minimizing Javascript, though JScript is not Javascript! I believe this because the error code is documented as a JScript error.
See https://msdn.microsoft.com/en-us/library/y3ca9cax(v=vs.90).aspx