Simplify configureCommands; focus an existing tab

Instead of isolating the deoptimization trigger:
https://github.com/petkaantonov/bluebird/wiki/Optimization-killers
This commit is contained in:
tophf 2017-03-26 12:02:06 +03:00
parent 55ac677d85
commit 54ab65989d

View File

@ -193,18 +193,9 @@ function wildcardAsRegExp(s, flags) {
} }
// isolate deoptimization trigger: const configureCommands = {
// https://github.com/petkaantonov/bluebird/wiki/Optimization-killers url: navigator.userAgent.includes('OPR')
// * Functions that contain object literals that contain __proto__, or get or set declarations. ? 'opera://settings/configureCommands'
const configureCommands = (() => ({ : 'chrome://extensions/configureCommands',
get url() { open: () => openURL({url: configureCommands.url}),
return navigator.userAgent.includes('OPR') };
? 'opera://settings/configureCommands'
: 'chrome://extensions/configureCommands';
},
open: () => {
chrome.tabs.create({
'url': configureCommands.url
});
}
}))();