Skip to content

Commit 34fe7a8

Browse files
committed
Better default checking
1 parent 0ebdf70 commit 34fe7a8

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/display/shader/Shader.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ var Shader = new Class({
2525

2626
function Shader (key, fragmentSrc, vertexSrc, uniforms)
2727
{
28-
if (fragmentSrc === undefined)
28+
if (!fragmentSrc || fragmentSrc === '')
2929
{
3030
fragmentSrc = [
3131
'precision mediump float;',
@@ -41,7 +41,7 @@ var Shader = new Class({
4141
].join('\n');
4242
}
4343

44-
if (vertexSrc === undefined)
44+
if (!vertexSrc || vertexSrc === '')
4545
{
4646
vertexSrc = [
4747
'precision mediump float;',
@@ -60,7 +60,7 @@ var Shader = new Class({
6060
].join('\n');
6161
}
6262

63-
if (uniforms === undefined) { uniforms = {}; }
63+
if (uniforms === undefined) { uniforms = null; }
6464

6565
/**
6666
* The key of this shader, unique within the shader cache of this Phaser game instance.
@@ -93,7 +93,7 @@ var Shader = new Class({
9393
* The default uniforms for this shader.
9494
*
9595
* @name Phaser.Display.Shader#uniforms
96-
* @type {any}
96+
* @type {?any}
9797
* @since 3.17.0
9898
*/
9999
this.uniforms = uniforms;

0 commit comments

Comments
 (0)