Comments (6)
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.
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.
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.
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.
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.
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)
- Update and include b2RopeJoint
- EdgeShapes are not fully implemented HOT 6
- Prismatic joints fail to function on bodies with fixedRotation set.
- enhance "demo" example to handle touch events HOT 4
- "Vector" polluting global namespace; conflicts with project defined Vector class
- Static/Kinematic bodies moving on Android 4 HOT 3
- use something like this to make demo more readable
- b2Body.GetFixtureList does not return a list
- Consider Moving to Github.com HOT 1
- QueryAABB only returns one overlapping fixture
- Support for world boundary Listener
- Box2D.js overwrite original Object.defineProperty HOT 5
- b2FixtureDef.isSensor = true dont fire contact events inside Adobe DPS HOT 1
- redefining defineProperty breaks on chrome
- Object.defineProperty polyfill breaks any other library dependent on that method. HOT 1
- Physics speed doubles when ran a second time
- b2Body inertia is not initialised
- Leaking memory: bodies are not removed from memory when destroyed (outside the world.Step function)
- Demo on home page doesn't work
- AddController doesn't update the m_prev of head
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from box2dweb.