summaryrefslogtreecommitdiff
path: root/js/shader.js
diff options
context:
space:
mode:
authortimb <opuscule@gmail.com>2014-01-24 23:44:35 -0800
committertimb <opuscule@gmail.com>2014-01-24 23:44:35 -0800
commite35a55d8dbc8696b0c5ab2f26cc4801957324394 (patch)
tree64ef4a96de83bdbd77f30f32d02d919f0a6d33c9 /js/shader.js
parent9584bf4f04fbbcc124c1572a5d69ba5b02a5409e (diff)
cleanup, error highlight less jumpy
Diffstat (limited to 'js/shader.js')
-rw-r--r--js/shader.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/js/shader.js b/js/shader.js
index 1d2e3e5..4a6e950 100644
--- a/js/shader.js
+++ b/js/shader.js
@@ -4,14 +4,11 @@ var shader_build = function(){
try {
var fn = new Function('x','y','t','d', fn_str)
shader = fn
- error_highlight.off()
shade = shade_error_handling
} catch (e) {
try {
acorn.parse(fn_str)
- } catch(e){
- /* loc: {column: 0, line: 1} */
- /* line is 1-based for some goddamn reason*/
+ } catch(e){ //e.loc = {column: 0, line: 1} line is 1-based
error_highlight.on(e.loc.line-1)
}
throw Error ("Shader compilation error")
@@ -89,6 +86,7 @@ function shade_error_handling(frame, t){
}
cc.putImageData(imgData,0,0)
shade = shade_no_error_handling
+ error_highlight.off()
}
shade = shade_error_handling \ No newline at end of file