Uglifyjs: Issue with v2.8.3 - Uncaught SyntaxError: Invalid left-hand side in for-loop

Created on 1 Mar 2017  路  6Comments  路  Source: mishoo/UglifyJS

We got that error in Chrome. The code which is underlined red in the sources tab says for(void 0 in n).

See attached code files of it working in v2.6.3 and the error in v2.8.3.

v2.8.3-ERROR.js.txt
v2.6.3-OK.js.txt

Most helpful comment

@lianqin7 after a bit more testing, yes. Should be within the next day.

Sorry for the trouble!

All 6 comments

Thanks for the report - #1524 should address that. If you can give that a spin to confirm that would be great.

If you can give me the original source so I can confirm as well that would also be great. I've just tried your v2.6.3-OK.js.txt and both 2.8.3 and #1524 do not produce any for(void 0.

What are your compress options, in case they are different from the defaults?

function isEmptyObject(e) {
  var t = void 0;
  for (t in e) {
    return !1;
  }return !0;
};

--uglifyjs@~2.8.0---->

function d(e){for(void 0 in e)return!1;return!0}     // error

--uglifyjs@~2.7.0---->

function d(e){var t=void 0;for(t in e)return!1;return!0}   // right

@lianqin7 thanks for the report. Your example is fixed by #1524:

function isEmptyObject(r){var n=void 0;for(n in r)return!1;return!0}

@alexlamsl it would be published by 2.8.?(next Z?)

@lianqin7 after a bit more testing, yes. Should be within the next day.

Sorry for the trouble!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

neverfox picture neverfox  路  4Comments

utdrmac picture utdrmac  路  4Comments

hacdias picture hacdias  路  5Comments

pvdz picture pvdz  路  3Comments

chrismanley picture chrismanley  路  5Comments