Skip to content

Commit b6ad117

Browse files
committed
Various jshint fixes.
1 parent 5ed79df commit b6ad117

2 files changed

Lines changed: 23 additions & 15 deletions

File tree

src/geom/Point.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -466,28 +466,33 @@ Phaser.Point.centroid = function (points, out) {
466466

467467
if (typeof out === "undefined") { out = new Phaser.Point(); }
468468

469-
if (Object.prototype.toString.call(points) !== '[object Array]') {
470-
throw new Error("Phaser.Point. Parameter 'points' must be an array")
469+
if (Object.prototype.toString.call(points) !== '[object Array]')
470+
{
471+
throw new Error("Phaser.Point. Parameter 'points' must be an array");
471472
}
472473

473474
var pointslength = points.length;
474475

475-
if (pointslength < 1) {
476-
throw new Error("Phaser.Point. Parameter 'points' array must not be empty")
476+
if (pointslength < 1)
477+
{
478+
throw new Error("Phaser.Point. Parameter 'points' array must not be empty");
477479
}
478480

479-
if (pointslength === 1) {
481+
if (pointslength === 1)
482+
{
480483
out.copyFrom(points[0]);
481484
return out;
482485
}
483486

484-
for (var i = 0; i < pointslength; i++) {
487+
for (var i = 0; i < pointslength; i++)
488+
{
485489
Phaser.Point.add(out, points[i], out);
486490
}
487491

488492
out.divide(pointslength, pointslength);
489493

490494
return out;
495+
491496
};
492497

493498
// Because PIXI uses its own Point, we'll replace it with ours to avoid duplicating code or confusion.

src/loader/Cache.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -595,28 +595,31 @@ Phaser.Cache.prototype = {
595595
{
596596
if (this._physics[key] && this._physics[key].data[object])
597597
{
598-
fixtures = this._physics[key].data[object];
598+
var fixtures = this._physics[key].data[object];
599599

600600
//try to find a fixture by it's fixture key if given
601601
if (fixtures && fixtureKey)
602602
{
603-
for(var fixture in fixtures)
603+
for (var fixture in fixtures)
604604
{
605-
//this contains the fixture data of a polygon or a circle
606-
fixture = fixtures[fixture]
607-
//test the key
608-
if(fixture.fixtureKey === fixtureKey)
605+
// This contains the fixture data of a polygon or a circle
606+
fixture = fixtures[fixture];
607+
608+
// Test the key
609+
if (fixture.fixtureKey === fixtureKey)
609610
{
610611
return fixture;
611612
}
613+
612614
}
613615

614-
//we did not find the requested fixture
616+
// We did not find the requested fixture
615617
console.warn('Phaser.Cache.getPhysicsData: Could not find given fixtureKey: "' + fixtureKey + ' in ' + key + '"');
616-
}else{
618+
}
619+
else
620+
{
617621
return fixtures;
618622
}
619-
620623
}
621624
else
622625
{

0 commit comments

Comments
 (0)