From 07bee69359ef0f253a60b5704e03303edfaf44d8 Mon Sep 17 00:00:00 2001 From: tophf Date: Wed, 22 Mar 2017 10:07:34 +0300 Subject: [PATCH] Fix deoptimization triggers --- edit.js | 4 ++-- messaging.js | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/edit.js b/edit.js index a2043067..7fc06efd 100644 --- a/edit.js +++ b/edit.js @@ -1551,8 +1551,8 @@ function showKeyMapHelp() { cell.innerHTML = cell.textContent; }); } - function mergeKeyMaps(merged) { - [].slice.call(arguments, 1).forEach(function(keyMap) { + function mergeKeyMaps(merged, ...more) { + more.forEach(keyMap => { if (typeof keyMap == "string") { keyMap = CodeMirror.keyMap[keyMap]; } diff --git a/messaging.js b/messaging.js index ba3aba52..f8173814 100644 --- a/messaging.js +++ b/messaging.js @@ -183,7 +183,10 @@ function wildcardAsRegExp(s, flags) { } -var configureCommands = { +// isolate deoptimization trigger: +// https://github.com/petkaantonov/bluebird/wiki/Optimization-killers +// * Functions that contain object literals that contain __proto__, or get or set declarations. +const configureCommands = (() => ({ get url () { return navigator.userAgent.indexOf('OPR') > -1 ? 'opera://settings/configureCommands' : @@ -194,4 +197,4 @@ var configureCommands = { 'url': configureCommands.url }); } -}; +}))();