Skip to content

Commit 8c18699

Browse files
committed
A hasOwnProperty check has been applied to the SceneManager.createSceneFromObject method when parsing additional properties in the extend object
1 parent d4bb75f commit 8c18699

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
* When calling `Shader.setRenderToTexture()` it will now draw the shader just once, immediately to the texture, to avoid the texture being blank for a single frame (thanks Kyle)
1313
* The private `Shader._savedKey` property has been removed as it wasn't used anywhere internally.
14+
* A `hasOwnProperty` check has been applied to the `SceneManager.createSceneFromObject` method when parsing additional properties in the `extend` object (thanks @halilcakar)
1415

1516
### Bug Fixes
1617

src/scene/SceneManager.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,7 @@ var SceneManager = new Class({
397397
* @method Phaser.Scenes.SceneManager#remove
398398
* @since 3.2.0
399399
*
400-
* @param {(string|Phaser.Scene)} scene - The Scene to be removed.
400+
* @param {string} key - A unique key used to reference the Scene, i.e. `MainMenu` or `Level1`.
401401
*
402402
* @return {Phaser.Scenes.SceneManager} This SceneManager.
403403
*/
@@ -768,6 +768,11 @@ var SceneManager = new Class({
768768
{
769769
for (var propertyKey in sceneConfig.extend)
770770
{
771+
if (!sceneConfig.extend.hasOwnProperty(propertyKey))
772+
{
773+
continue;
774+
}
775+
771776
var value = sceneConfig.extend[propertyKey];
772777

773778
if (propertyKey === 'data' && newScene.hasOwnProperty('data') && typeof value === 'object')

0 commit comments

Comments
 (0)