(source)
| 105 | } |
| 106 | |
| 107 | var wrap = function(source) { |
| 108 | // TODO: is there another way than generating this code? |
| 109 | var s = ""; |
| 110 | s += 'try {\n'; |
| 111 | s += requires + source + '\n'; |
| 112 | s += '} catch (e) {\n'; |
| 113 | s += ' console.log("ERROR: Execution of script \'' + script.name + '\' failed! " + e.message); \n'; |
| 114 | s += ' console.log(e.stack.replace(/\\(eval at <anonymous> /g, "").replace(/<anonymous>:/g, "").replace(/chrome-extension:\\/\\/[\\w]{32}\\/content\\.js:\\d*:\\d*\\)*, /g, ""))\n'; |
| 115 | s += '}\n'; |
| 116 | return s; |
| 117 | }; |
| 118 | |
| 119 | setid = 'arguments.callee.setID({ id: "' + script.id + '", run_at: "' + script.options.run_at + '", ns: "' + script['namespace'] + '" });\n'; |
| 120 |
no test coverage detected
searching dependent graphs…