diff options
author | Christopher Smith <chris@jalakai.co.uk> | 2013-08-01 13:07:34 -0700 |
---|---|---|
committer | Christopher Smith <chris@jalakai.co.uk> | 2013-08-01 13:07:34 -0700 |
commit | 991a5ddd298562a9b0e37df25cb7e682519ccf7a (patch) | |
tree | ae941b585cab395c7b252cc446b1dc8180d013f3 /lib/exe | |
parent | 5537fd88dc60d76d6a85202f715aa1ef585281a9 (diff) | |
parent | c6f665dd924dfa715fc19140c26d25eddcef9841 (diff) | |
download | rpg-991a5ddd298562a9b0e37df25cb7e682519ccf7a.tar.gz rpg-991a5ddd298562a9b0e37df25cb7e682519ccf7a.tar.bz2 |
Merge pull request #238 from splitbrain/logjserrors
In debug mode: catch and log JS errors with file information
Diffstat (limited to 'lib/exe')
-rw-r--r-- | lib/exe/js.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/exe/js.php b/lib/exe/js.php index 4ff48133e..06769d895 100644 --- a/lib/exe/js.php +++ b/lib/exe/js.php @@ -104,10 +104,13 @@ function js_out(){ // load files foreach($files as $file){ $ismin = (substr($file,-7) == '.min.js'); + $debugjs = ($conf['allowdebug'] && strpos($file, DOKU_INC.'lib/scripts/') !== 0); echo "\n\n/* XXXXXXXXXX begin of ".str_replace(DOKU_INC, '', $file) ." XXXXXXXXXX */\n\n"; if($ismin) echo "\n/* BEGIN NOCOMPRESS */\n"; + if ($debugjs) echo "\ntry {\n"; js_load($file); + if ($debugjs) echo "\n} catch (e) {\n logError(e, '".str_replace(DOKU_INC, '', $file)."');\n}\n"; if($ismin) echo "\n/* END NOCOMPRESS */\n"; echo "\n\n/* XXXXXXXXXX end of " . str_replace(DOKU_INC, '', $file) . " XXXXXXXXXX */\n\n"; } |