renderer: shaders: nicer error message syntax

This commit is contained in:
Matthias Schiffer 2020-02-25 22:42:39 +01:00
parent bfdecdbd3c
commit 448d8c52a4
Signed by: neocturne
GPG key ID: 16EF3F64CB201D9C

View file

@ -61,14 +61,14 @@ export class Shaders {
private getAttribLocation(program: WebGLProgram, name: string): number { private getAttribLocation(program: WebGLProgram, name: string): number {
const ret = this.gl.getAttribLocation(program, name); const ret = this.gl.getAttribLocation(program, name);
if (ret < 0) throw new Error("unable to get location of attribute '" + name + "'"); if (ret < 0) throw new Error(`unable to get location of attribute '${name}'`);
return ret; return ret;
} }
private getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation { private getUniformLocation(program: WebGLProgram, name: string): WebGLUniformLocation {
const ret = this.gl.getUniformLocation(program, name); const ret = this.gl.getUniformLocation(program, name);
if (!ret) throw new Error("unable to get location of uniform '" + name + "'"); if (!ret) throw new Error(`unable to get location of uniform '${name}'`);
return ret; return ret;
} }