diff --git a/addScript.js b/addScript.js index 6aaf09d..b29d6e3 100644 --- a/addScript.js +++ b/addScript.js @@ -3,8 +3,15 @@ Author Tobias Koppers @sokra */ module.exports = function(src) { - if (typeof execScript !== "undefined") - execScript(src); - else - eval.call(null, src); + try { + if (typeof eval !== "undefined") { + eval.call(null, src); + } else if (typeof execScript !== "undefined") { + execScript(src); + } else { + console.error("[Script Loader] EvalError: No eval function available"); + } + } catch (error) { + console.error("[Script Loader] ", error.message); + } }