Merge pull request #9453 from tschaub/for-key-in-uniforms

Remove unnecessary closure and fix uniform type
This commit is contained in:
Tim Schaub
2019-04-23 17:20:26 -06:00
committed by GitHub
+9 -7
View File
@@ -90,7 +90,7 @@ export const DefaultAttrib = {
/** /**
* @typedef {Object} UniformInternalDescription * @typedef {Object} UniformInternalDescription
* @property {string} name Name * @property {string} name Name
* @property {UniformLiteralValue=} value Value * @property {UniformValue=} value Value
* @property {WebGLTexture} [texture] Texture * @property {WebGLTexture} [texture] Texture
* @private * @private
*/ */
@@ -316,12 +316,14 @@ class WebGLHelper extends Disposable {
* @private * @private
*/ */
this.uniforms_ = []; this.uniforms_ = [];
options.uniforms && Object.keys(options.uniforms).forEach(function(name) { if (options.uniforms) {
this.uniforms_.push({ for (const name in options.uniforms) {
name: name, this.uniforms_.push({
value: options.uniforms[name] name: name,
}); value: options.uniforms[name]
}.bind(this)); });
}
}
/** /**
* An array of PostProcessingPass objects is kept in this variable, built from the steps provided in the * An array of PostProcessingPass objects is kept in this variable, built from the steps provided in the