Skip to content
This repository was archived by the owner on Nov 5, 2019. It is now read-only.

Commit 370ff3d

Browse files
emememwjoshwiens
authored andcommitted
fix: modify script evaluation for IE11 (#41)
Closes #39 Closes #41
1 parent 162ab8b commit 370ff3d

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

addScript.js

+11-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@
33
Author Tobias Koppers @sokra
44
*/
55
module.exports = function(src) {
6-
if (typeof execScript !== "undefined")
7-
execScript(src);
8-
else
9-
eval.call(null, src);
6+
try {
7+
if (typeof eval !== "undefined") {
8+
eval.call(null, src);
9+
} else if (typeof execScript !== "undefined") {
10+
execScript(src);
11+
} else {
12+
console.error("[Script Loader] EvalError: No eval function available");
13+
}
14+
} catch (error) {
15+
console.error("[Script Loader] ", error.message);
16+
}
1017
}

0 commit comments

Comments
 (0)