Skip to content

Commit 1966839

Browse files
authored
Replace window.eval with Function (#9611)
* Replace window.eval with Function * Add back comment
1 parent 42a3928 commit 1966839

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

boot/boot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ $tw.utils.evalGlobal = function(code,context,filename,sandbox,allowGlobals) {
613613
// Compile the code into a function
614614
var fn;
615615
if($tw.browser) {
616-
fn = window["eval"](code + "\n\n//# sourceURL=" + filename); // eslint-disable-line no-eval -- See https://github.com/TiddlyWiki/TiddlyWiki5/issues/6839
616+
fn = Function("return " + code + "\n\n//# sourceURL=" + filename)(); // See https://github.com/TiddlyWiki/TiddlyWiki5/issues/6839
617617
} else {
618618
if(sandbox){
619619
fn = vm.runInContext(code,sandbox,filename)

0 commit comments

Comments
 (0)