Giter Site home page Giter Site logo

Comments (5)

douglascrockford avatar douglascrockford commented on July 23, 2024

A problem I have had historically is that if one of my tools accepts code that is badly written, then it is assumed that 'I' am approving, which I am not. That is why made that change in 2012. Up until now, no one has complained.

There is a lot of stupid stuff happening in that highcharts code, but I am past caring about it. JSMin will now accept it.

from jsmin.

li-a avatar li-a commented on July 23, 2024

Thanks for looking. The "badly written" code here is output from minification, not meant for human consumption. Highcharts source happens to look friendlier:

if (/(NaN| {2}|^$)/.test(value)) {
	value = 'M 0 0';
}

(and minifies fine w/ JsMin).

Ugliness or other badness aside, as far as I can tell, the JsMin input here is valid ES 3 and the output is not. We have an easy workaround for this one, but we believe this hits many codebase files that are not highcharts.

I didn't realize JsMin was being maintained, and we have seen the usage warning/caveats, but I filed this in case someone else is searching around. Will post a fix if we make one.

(Of course we shouldn't be passing pre-minified code through JsMin anyway; that's a future fix.)

from jsmin.

li-a avatar li-a commented on July 23, 2024

Some simplified failure cases:

  • ;/a# b/; --> ;/a#b/;
  • ;/a| b/; --> ;/a|b/;
  • ;/# /; --> ;/#/;
  • ;/| /; --> Error: Unterminated regular expression at line 0 and column 7

The leading semicolon seems to be significant.

from jsmin.

douglascrockford avatar douglascrockford commented on July 23, 2024

I think this is fixed in the latest.

Why are you minifying minified code?

from jsmin.

li-a avatar li-a commented on July 23, 2024

Confirmed all our cases are resolved. I didn't notice changes went in, thanks for looking.

The double minification fix is planned.

from jsmin.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.