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

Commit edd8369

Browse files
author
Markus Wirsing
committed
Modified script evaluation for IE11. Ref #36
1 parent 46e7bfc commit edd8369

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.log("no eval function available");
13+
}
14+
} catch (error) {
15+
console.log("script evaluation error occurred", error);
16+
}
1017
}

0 commit comments

Comments
 (0)