mirror of
https://github.com/systemjs/systemjs.git
synced 2026-01-25 14:57:38 +00:00
better error reporting
This commit is contained in:
parent
803dd46734
commit
e05a18fc9d
13
loader.js
13
loader.js
@ -845,9 +845,16 @@
|
||||
|
||||
// carefully scoped eval with given global
|
||||
var __scopedEval = function(__source, global, __sourceURL, __sourceMappingURL) {
|
||||
eval('with(global) { (function() { ' + __source + ' \n }).call(global); }'
|
||||
+ (__sourceURL && !__source.match(/\/\/[@#] ?(sourceURL|sourceMappingURL)=(.+)/)
|
||||
? '\n//# sourceURL=' + __sourceURL : ''));
|
||||
try {
|
||||
eval('with(global) { (function() { ' + __source + ' \n }).call(global); }'
|
||||
+ (__sourceURL && !__source.match(/\/\/[@#] ?(sourceURL|sourceMappingURL)=(.+)/)
|
||||
? '\n//# sourceURL=' + __sourceURL : ''));
|
||||
}
|
||||
catch(e) {
|
||||
if (e.name == 'SyntaxError')
|
||||
e.message = 'Evaluating ' + __sourceURL + '\n\t' + e.message;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
})();
|
||||
|
||||
@ -71,6 +71,15 @@
|
||||
return 'Error defining module';
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Error handling',
|
||||
run: function(complete) {
|
||||
jspm.import('./tests/error', complete);
|
||||
},
|
||||
confirm: function() {
|
||||
return;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'Global script loading',
|
||||
run: function(complete) {
|
||||
|
||||
3
test/tests/error.js
Normal file
3
test/tests/error.js
Normal file
@ -0,0 +1,3 @@
|
||||
setTimeout(function() {
|
||||
throw 'error';
|
||||
}, 1000);
|
||||
Loading…
x
Reference in New Issue
Block a user