Skip to content

Commit

Permalink
Fix evaluation of nullish constants.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakuna committed Jun 29, 2021
1 parent 4fcea52 commit b89e9bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/webgl/Program.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export class Program {
}

// TODO: Can be minified with optional chaining and a nullish coalescing operator once Bundlephobia supports them.
if (!value) {
if (value == undefined) {
throw new Error(`Uniform ${name} was not supplied.`);
}
if (value.value == undefined) {
Expand All @@ -148,7 +148,7 @@ export class Program {
}

// Other uniforms.
return setUniform(uniform.activeInfo.type, uniform.location, uniform.value);
return setUniform(uniform.activeInfo.type, uniform.location, value.value);
}

this.applyState();
Expand Down

0 comments on commit b89e9bf

Please sign in to comment.