mirror of
https://github.com/jsbin/jsbin.git
synced 2026-01-25 15:38:56 +00:00
Slightly more error reporting info - though does not appear to fire at all in firefox...
This commit is contained in:
parent
1144825e74
commit
ecfae4e9a9
@ -51,7 +51,7 @@ var getPreparedCode = (function () {
|
||||
try { // the try/catch is to catch and preprocessor errors
|
||||
js = editors.javascript.render();
|
||||
|
||||
if (js.trim()) js += '\n\n// created @ ' + two(date.getHours()) + ':' + two(date.getMinutes()) + ':' + two(date.getSeconds());
|
||||
if (js.trim()) js += '\n\n//# sourceURL=jsbin-' + two(date.getHours()) + two(date.getMinutes()) + two(date.getSeconds()) + '.js';
|
||||
} catch (e) {
|
||||
window.console && window.console.error(e.message);
|
||||
}
|
||||
|
||||
@ -92,11 +92,11 @@ var runner = (function () {
|
||||
loopProtect.reset();
|
||||
|
||||
// if there's a parse error this will fire
|
||||
childWindow.onerror = function (msg, url, line) {
|
||||
childWindow.onerror = function (msg, url, line, col, error) {
|
||||
// show an error on the jsbin console, but not the browser console
|
||||
// (i.e. use _raw), because the browser will throw the native error
|
||||
// which (hopefully) includes a link to the JavaScript VM at that time.
|
||||
proxyConsole._raw('error', msg + ' (line ' + line + ')');
|
||||
proxyConsole._raw('error', error && error.stack ? error.stack : msg + ' (line ' + line + ')');
|
||||
};
|
||||
|
||||
// Write the source out. IE crashes if you have lots of these, so that's
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user