forked from enviPath/enviPy
Current Dev State
This commit is contained in:
14
static/js/ketcher2/node_modules/tryit/tryit.js
generated
vendored
Normal file
14
static/js/ketcher2/node_modules/tryit/tryit.js
generated
vendored
Normal file
@ -0,0 +1,14 @@
|
||||
// tryit
|
||||
// Simple, re-usuable try-catch, this is a performance optimization
|
||||
// and provides a cleaner API.
|
||||
module.exports = function (fn, cb) {
|
||||
var err;
|
||||
|
||||
try {
|
||||
fn();
|
||||
} catch (e) {
|
||||
err = e;
|
||||
}
|
||||
|
||||
if (cb) cb(err || null);
|
||||
};
|
||||
Reference in New Issue
Block a user