From f1a5a67ce33fe0a29db3967d8a7990185f5748d3 Mon Sep 17 00:00:00 2001 From: Jagua Date: Thu, 3 Sep 2015 01:31:58 +0900 Subject: Dropped let expression for Firefox 41+ --- microsoft-translator.js | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/microsoft-translator.js b/microsoft-translator.js index 44ae587..c6a864a 100644 --- a/microsoft-translator.js +++ b/microsoft-translator.js @@ -1,6 +1,6 @@ /* NEW BSD LICENSE {{{ Copyright (c) 2009-2010, anekos. -Copyright (c) 2012-2014, Jagua. +Copyright (c) 2012-2015, Jagua. All rights reserved. Redistribution and use in source and binary forms, with or without modification, @@ -282,6 +282,8 @@ let INFO = xml` function (text) util.copyToClipboard(text, true) }; + let actionTypes = [n for (n in actions)]; + function makeListValidator (list) function (vs) (!vs || !vs.some(function (v) !list.some(function (at) (v == at)))); @@ -319,9 +321,10 @@ let INFO = xml` actionNames.push('echo'); function setPair () { - if ((!from ^ !to) && settings.pair.length >= 2) - let (v = settings.pair[(settings.pair[0] == (from || to)) - 0]) - (from ? (to = v) : (from = v)); + if ((!from ^ !to) && settings.pair.length >= 2) { + let v = settings.pair[(settings.pair[0] == (from || to)) - 0]; + (from ? (to = v) : (from = v)); + } } function req () { @@ -360,19 +363,18 @@ let INFO = xml` literal: 0, bang: true, options: - let (actionTypes = [n for (n in actions)]) + [ [ - [ - ['-action', '-a'], - commands.OPTION_LIST, - makeListValidator(actionTypes), - actionTypes.map(function (v) [v, v]), - true - ], - [['-from', '-f'], commands.OPTION_STRING, null, languages], - [['-to', '-t'], commands.OPTION_STRING, null, languages], - [['-guess', '-g'], commands.OPTION_NOARG] + ['-action', '-a'], + commands.OPTION_LIST, + makeListValidator(actionTypes), + actionTypes.map(function (v) [v, v]), + true ], + [['-from', '-f'], commands.OPTION_STRING, null, languages], + [['-to', '-t'], commands.OPTION_STRING, null, languages], + [['-guess', '-g'], commands.OPTION_NOARG] + ], }, true ); -- cgit v1.2.3