Reduce use of eval()

This commit is contained in:
YUKI Hiroshi 2015-11-05 19:24:10 +09:00
parent 330e7503aa
commit be899d1b52

View File

@ -299,12 +299,12 @@ var TreeStyleTabWindowHelper = {
}, 'treeStyleTab'); }, 'treeStyleTab');
} }
TreeStyleTabUtils.doPatching(FullScreen.toggle, 'FullScreen.toggle', function(aName, aSource) { FullScreen.__treestyletab__toggle = FullScreen.toggle;
return eval(aName+' = '+aSource.replace( FullScreen.toggle = function(...aArgs) {
'if (enterFS) {', var enterFS = window.fullScreen;
'gBrowser.treeStyleTab.onBeforeFullScreenToggle(enterFS); $&' gBrowser.treeStyleTab.onBeforeFullScreenToggle(enterFS);
)); return this.__treestyletab__toggle.apply(this, aArgs);
}, 'treeStyleTab'); };
PrintUtils.__treestyletab__printPreview = PrintUtils.printPreview; PrintUtils.__treestyletab__printPreview = PrintUtils.printPreview;
PrintUtils.printPreview = function(...aArgs) { PrintUtils.printPreview = function(...aArgs) {