diff options
| author | timb <opuscule@gmail.com> | 2014-01-24 08:06:08 -0800 |
|---|---|---|
| committer | timb <opuscule@gmail.com> | 2014-01-24 08:06:08 -0800 |
| commit | 9584bf4f04fbbcc124c1572a5d69ba5b02a5409e (patch) | |
| tree | fcba3b965f99a646305d0d17c4cf73d05e4dfd7a | |
| parent | 89bf91e68f1fac2d88eb97c7fe324753a5ef76cf (diff) | |
slight cleanup
| -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 |
