I am trying to compile a "garbage" shader, feeding in some garbage code to WebGL (see here for a fiddle):
gl = $('canvas')[0].getContext('experimental-webgl');
source = 'garbage12398sv;aa[]|\[12';
shader = gl.createShader(gl.FRAGMENT_SHADER);
gl.shaderSource(shader, source);
gl.compileShader(shader);
console.log(gl.getError() === gl.NO_ERROR);
Surprisingly, gl.getError() === gl.NO_ERROR is true despite asking WebGL to compile some garbage.
Why doesn't getError flag an error? How can I get error information regarding the compilation status of my shaders?