Skip to content

Commit

Permalink
Merge pull request #6234 from AnalyticalGraphicsInc/fix-typo
Browse files Browse the repository at this point in the history
Fix typo when cloning ShaderSource.
  • Loading branch information
Hannah authored Feb 21, 2018
2 parents 3736538 + 53bacc5 commit 16fd74e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Source/Renderer/ShaderSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ define([
return new ShaderSource({
sources : this.sources,
defines : this.defines,
pickColorQuantifier : this.pickColorQualifier,
pickColorQualifier : this.pickColorQualifier,
includeBuiltIns : this.includeBuiltIns
});
};
Expand Down
18 changes: 18 additions & 0 deletions Specs/Renderer/ShaderSourceSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,22 @@ defineSuite([
var shaderText = source.createCombinedVertexShader(mockContext);
expect(shaderText).toStartWith('#version 300 es\n');
});

it('clones', function() {
var source = new ShaderSource({
defines : ['A'],
sources : ['void main() { gl_FragColor = vec4(1.0); }'],
pickColorQualifier : 'varying',
includeBuiltIns : false
});
var clone = source.clone();
expect(clone.defines).toBeDefined();
expect(clone.defines.length).toEqual(1);
expect(clone.defines[0]).toEqual(source.defines[0]);
expect(clone.sources).toBeDefined();
expect(clone.sources.length).toEqual(1);
expect(clone.sources[0]).toEqual(source.sources[0]);
expect(clone.pickColorQualifier).toEqual(source.pickColorQualifier);
expect(clone.includeBuiltIns).toEqual(source.includeBuiltIns);
});
});

0 comments on commit 16fd74e

Please sign in to comment.