Skip to content

Commit 56249c8

Browse files
authored
Merge pull request phaserjs#3091 from Twilrom/bugfixes
Bugfixes
2 parents 3266974 + c304957 commit 56249c8

4 files changed

Lines changed: 19 additions & 22 deletions

File tree

v3/src/events/EventDispatcher.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ var EventDispatcher = new Class({
212212
{
213213
for (var binding in this.bindings)
214214
{
215-
binding.destroy();
215+
this.bindings[binding].destroy();
216216
}
217217

218218
this.bindings = {};

v3/src/loader/File.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,17 @@ var File = new Class({
174174
*/
175175
File.createObjectURL = function (image, blob, defaultType)
176176
{
177-
if(URL)
177+
if (typeof URL === 'function')
178178
{
179179
image.src = URL.createObjectURL(blob);
180180
}
181181
else
182182
{
183183
var reader = new FileReader();
184184

185-
reader.onload = function()
185+
reader.onload = function ()
186186
{
187-
delete image.crossOrigin;
187+
image.removeAttribute('crossOrigin');
188188
image.src = 'data:' + (blob.type || defaultType) + ';base64,' + reader.result.split(',')[1];
189189
};
190190

v3/src/scene/plugins/DataStore.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,18 @@ var DataStore = new Class({
7777
return data.after(key, callback, scope);
7878
},
7979

80-
each: function (gameObject, callback, scope, args)
80+
each: function (gameObject, callback, scope)
8181
{
8282
var data = this.getData(gameObject);
8383

8484
return data.each(callback, scope);
8585
},
8686

87-
merge: function (gameObject, data, overwrite)
87+
merge: function (gameObject, _data, overwrite)
8888
{
8989
var data = this.getData(gameObject);
9090

91-
return data.merge(data, overwrite);
91+
return data.merge(_data, overwrite);
9292
},
9393

9494
remove: function (gameObject, key)

v3/src/utils/Class.js

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function hasGetterOrSetter (def)
88
function getProperty (definition, k, isClassDescriptor)
99
{
1010
// This may be a lightweight object, OR it might be a property that was defined previously.
11-
11+
1212
// For simple class descriptors we can just assume its NOT previously defined.
1313
var def = (isClassDescriptor) ? definition[k] : Object.getOwnPropertyDescriptor(definition, k);
1414

@@ -74,7 +74,7 @@ function extend (ctor, definition, isClassDescriptor, extend)
7474
if (def !== false)
7575
{
7676
// If Extends is used, we will check its prototype to see if the final variable exists.
77-
77+
7878
var parent = extend || ctor;
7979

8080
if (hasNonConfigurable(parent.prototype, k))
@@ -136,7 +136,7 @@ function mixin (myClass, mixins)
136136
* @example
137137
*
138138
* var MyClass = new Phaser.Class({
139-
*
139+
*
140140
* initialize: function() {
141141
* this.foo = 2.0;
142142
* },
@@ -171,21 +171,18 @@ function Class (definition)
171171
// here since we only call this on class creation (i.e. not object creation).
172172
delete definition.initialize;
173173
}
174-
else
174+
else if (definition.Extends)
175175
{
176-
if (definition.Extends)
177-
{
178-
var base = definition.Extends;
176+
var base = definition.Extends;
179177

180-
initialize = function ()
181-
{
182-
base.apply(this, arguments);
183-
};
184-
}
185-
else
178+
initialize = function ()
186179
{
187-
initialize = function () {};
188-
}
180+
base.apply(this, arguments);
181+
};
182+
}
183+
else
184+
{
185+
initialize = function () {};
189186
}
190187

191188
if (definition.Extends)

0 commit comments

Comments
 (0)