From 9584bf4f04fbbcc124c1572a5d69ba5b02a5409e Mon Sep 17 00:00:00 2001 From: timb Date: Fri, 24 Jan 2014 08:06:08 -0800 Subject: slight cleanup --- js/shader.js | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'js') diff --git a/js/shader.js b/js/shader.js index 003f543..1d2e3e5 100644 --- a/js/shader.js +++ b/js/shader.js @@ -73,19 +73,17 @@ function shade_error_handling(frame, t){ } catch(e){ var lines = (e.stack + "").split('\n') - if (lines[0].substr(0,10) === "anonymous@") { //firefox + if (lines[0].substr(0,10) === "anonymous@") { // firefox var matches = lines[0].match(firefox_stack_regexp) - if (matches.length > 1) { - var line = parseInt(matches[1]) - 5 - error_highlight.on(line) - } + if (matches.length > 1) + error_highlight.on(parseInt(matches[1]) - 5) + } else if (lines.length > 1) { // attempt chrome match var matches = lines[1].match(chrome_stack_regexp) - if (matches.length > 1) { - var line = parseInt(matches[1]) - 3 - error_highlight.on(line) - } + if (matches.length > 1) + error_highlight.on(parseInt(matches[1]) - 3) } + // console.log(e.stack) throw Error ("Shader execution error") } @@ -93,7 +91,4 @@ function shade_error_handling(frame, t){ shade = shade_no_error_handling } -shade = shade_error_handling - -// :4:11) -// "anonymous@http://dither.local/js/shader.js:6" \ No newline at end of file +shade = shade_error_handling \ No newline at end of file -- cgit v1.2.3-70-g09d2