js: Avoid double declarations with let

The following code is a syntax error in ES6:

    let a = 'something';
    let a = 'other thing';

Previously GJS would silently accept this code, but in the next release the
SpiderMonkey JS engine will be more ES6-compliant.

https://bugzilla.gnome.org/show_bug.cgi?id=778425
This commit is contained in:
Philip Chimento
2017-02-09 18:12:59 -08:00
committed by Philip Chimento
parent f7752ac699
commit aefd61c3db
4 changed files with 4 additions and 4 deletions

View File

@ -128,7 +128,8 @@ const KeyboardManager = new Lang.Class({
if (!found)
[, , id] = GnomeDesktop.get_input_source_from_locale(DEFAULT_LOCALE);
let [found, , , _layout, _variant] = this._xkbInfo.get_layout_info(id);
let _layout, _variant;
[found, , , _layout, _variant] = this._xkbInfo.get_layout_info(id);
if (found)
return { layout: _layout, variant: _variant };
else