Skip to content

Commit 2cb9ea3

Browse files
committed
extension URL fix, jsdoc fix and small format changes.
1 parent 3fc8fba commit 2cb9ea3

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

src/loader/Loader.js

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,9 +354,11 @@ Phaser.Loader.prototype = {
354354
for (var i = 0; i < this._fileList.length; i++)
355355
{
356356
var file = this._fileList[i];
357+
357358
if (file.type === type && file.key === key)
358359
{
359360
bestFound = i;
361+
360362
// An already loaded/loading file may be superceded.
361363
if (!file.loaded && !file.loading)
362364
{
@@ -460,6 +462,7 @@ Phaser.Loader.prototype = {
460462
if (overwrite && fileIndex > -1)
461463
{
462464
var currentFile = this._fileList[fileIndex];
465+
463466
if (!currentFile.loading && !currentFile.loaded)
464467
{
465468
this._fileList[fileIndex] = file;
@@ -655,6 +658,7 @@ Phaser.Loader.prototype = {
655658
script: function (key, url, callback, callbackContext) {
656659

657660
if (typeof callback === 'undefined') { callback = false; }
661+
658662
// Why is the default callback context the ..callback?
659663
if (callback !== false && typeof callbackContext === 'undefined') { callbackContext = callback; }
660664

@@ -682,6 +686,7 @@ Phaser.Loader.prototype = {
682686
binary: function (key, url, callback, callbackContext) {
683687

684688
if (typeof callback === 'undefined') { callback = false; }
689+
685690
// Why is the default callback context the ..callback?
686691
if (callback !== false && typeof callbackContext === 'undefined') { callbackContext = callback; }
687692

@@ -1039,6 +1044,7 @@ Phaser.Loader.prototype = {
10391044
withSyncPoint: function (callback, callbackContext) {
10401045

10411046
this._withSyncPointDepth++;
1047+
10421048
try {
10431049
callback.call(callbackContext || this, this);
10441050
} finally {
@@ -1062,6 +1068,7 @@ Phaser.Loader.prototype = {
10621068
addSyncPoint: function (type, key) {
10631069

10641070
var asset = this.getAsset(type, key);
1071+
10651072
if (asset)
10661073
{
10671074
asset.file.syncPoint = true;
@@ -1086,7 +1093,8 @@ Phaser.Loader.prototype = {
10861093

10871094
if (asset)
10881095
{
1089-
if (!asset.loaded && !asset.loading) {
1096+
if (!asset.loaded && !asset.loading)
1097+
{
10901098
this._fileList.splice(asset.index, 1);
10911099
}
10921100
}
@@ -1268,7 +1276,9 @@ Phaser.Loader.prototype = {
12681276
// Flight queue is empty but file list is not done being processed.
12691277
// This indicates a critical internal error with no known recovery.
12701278
console.warn("Phaser.Loader - aborting: processing queue empty, loading may have stalled");
1279+
12711280
var _this = this;
1281+
12721282
setTimeout(function () {
12731283
_this.finishedLoading(true);
12741284
}, 2000);
@@ -1321,6 +1331,7 @@ Phaser.Loader.prototype = {
13211331

13221332
file.loaded = true;
13231333
file.error = !!errorMessage;
1334+
13241335
if (errorMessage)
13251336
{
13261337
file.errorMessage = errorMessage;
@@ -1765,7 +1776,8 @@ Phaser.Loader.prototype = {
17651776
url = url.substr(0, url.indexOf("?"));
17661777
}
17671778

1768-
var extension = url.substr((Math.max(0, extension.lastIndexOf(".")) || Infinity) + 1);
1779+
var extension = url.substr((Math.max(0, url.lastIndexOf(".")) || Infinity) + 1);
1780+
17691781
audioType = extension.toLowerCase();
17701782
}
17711783

@@ -1780,7 +1792,7 @@ Phaser.Loader.prototype = {
17801792
},
17811793

17821794
/**
1783-
* Error occured when loading a file.
1795+
* Error occurred when loading a file.
17841796
*
17851797
* @method Phaser.Loader#fileError
17861798
* @private
@@ -2167,7 +2179,7 @@ Phaser.Loader.prototype = {
21672179
* A general indicator of the progress.
21682180
* It is possible for the progress to decrease, after `onLoadStart`, if more files are dynamically added.
21692181
*
2170-
* @memberof Phaser.Loader#progressFloat
2182+
* @name Phaser.Loader#progressFloat
21712183
* @property {number}
21722184
*/
21732185
Object.defineProperty(Phaser.Loader.prototype, "progressFloat", {

0 commit comments

Comments
 (0)