Git Product home page Git Product logo

Comments (6)

GoogleCodeExporter avatar GoogleCodeExporter commented on May 29, 2024
Hi,

Is there a good source which confirms your claim?

If I remember correctly, I had some problems with minification when removing 
them, but I'm not sure. Furthermore I read somewhere that they belong there, 
but came to the conclusion that they don't make sense.

Original comment by [email protected] on 29 Aug 2011 at 11:17

from box2dweb.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 29, 2024
http://www.jslint.com/

should hopefully provide an answer.  Minification often requires extra 
semicolons to work flawlessly (because it gets rid of whitespace including 
times where ECMAscript treats a newline differently than a space.  Extra ;'s 
aren't going to hurt anything but if you want syntactical perfection the domain 
above is your definitive guide.

Original comment by [email protected] on 29 Aug 2011 at 4:02

from box2dweb.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 29, 2024
It's not "[my] claim" - it's the syntactic ASI rules of JavaScript as set forth 
by the ECMAScript spec - dating back to ES1. And yes, JSLint will confirm this, 
eg.

    function foo() {
        return true;
    };            

JSLint Result:

    Problem at line 3 character 2: Unexpected ';'.


As far as minification is concerned, the only expectation is that semi-colons 
are inserted correctly and you'll have no issues. The problem years ago 
centered around concatenating files from varying sources with varying 
reliability.

Original comment by [email protected] on 29 Aug 2011 at 4:58

from box2dweb.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 29, 2024
Yes, JSLint is a perfect source and confirms it. Maybe, "claim" was the wrong 
word to choose ;)

Original comment by [email protected] on 29 Aug 2011 at 5:07

  • Changed state: Accepted

from box2dweb.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 29, 2024
I would recommend a slightly modified function declaration style which is 
correct to add a semi-colon at the end, I believe it is a bit cleaner (and 
shorter than the style you have now):

change:
   function b2Body() {
      ...
   };
   Box2D.Dynamics.b2Body = b2Body;

to:
   Box2D.Dynamics.b2Body = function () {
      ...
   };

Original comment by [email protected] on 24 Apr 2012 at 3:53

from box2dweb.

GoogleCodeExporter avatar GoogleCodeExporter commented on May 29, 2024
I'm working on a new version of my compiler at the moment which will not 
produce such a code.

Original comment by [email protected] on 24 Apr 2012 at 5:13

from box2dweb.

Related Issues (20)

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.