diff options
Diffstat (limited to 'js')
| -rw-r--r-- | js/shader.js | 21 |
1 files changed, 8 insertions, 13 deletions
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 - -// <anonymous>: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 |
