[gnome-sound-recorder/wip/jtojnar/es6: 6/9] Use var instead of let or const



commit 7c6742656153dddf681a23536da91415a59ea3dd
Author: Jan Tojnar <jtojnar gmail com>
Date:   Fri Jan 18 00:39:31 2019 +0100

    Use var instead of let or const
    
    Now only for module members used externally, I marked them with a comment.
    Hopefully we will be able to get rid of var once GJS implements ES6 modules.
    
    https://gitlab.gnome.org/GNOME/gjs/merge_requests/150

 src/application.js  | 10 +++++-----
 src/audioProfile.js |  8 ++++----
 src/fileUtil.js     |  5 +++--
 src/info.js         |  3 ++-
 src/listview.js     |  3 ++-
 src/mainWindow.js   | 34 +++++++++++++++++++---------------
 src/play.js         |  3 ++-
 src/preferences.js  |  3 ++-
 src/record.js       |  3 ++-
 src/waveform.js     |  3 ++-
 10 files changed, 43 insertions(+), 32 deletions(-)
---
diff --git a/src/application.js b/src/application.js
index cd01c03..dca02cd 100644
--- a/src/application.js
+++ b/src/application.js
@@ -1,3 +1,4 @@
+/* exported SIGINT SIGTERM application Application */
 /*
 * Copyright 2013 Meg Ford
 * This library is free software; you can redistribute it and/or
@@ -27,14 +28,13 @@ const MainWindow = imports.mainWindow;
 const Preferences = imports.preferences;
 const Util = imports.util;
 
-const SIGINT = 2;
-const SIGTERM = 15;
+var SIGINT = 2;
+var SIGTERM = 15;
 
-let application = null;
+var application = null;
 let settings = null;
 
-
-const Application = new Lang.Class({
+var Application = new Lang.Class({
     Name: 'Application',
     Extends: Gtk.Application,
 
diff --git a/src/audioProfile.js b/src/audioProfile.js
index 5143701..ffec841 100644
--- a/src/audioProfile.js
+++ b/src/audioProfile.js
@@ -1,3 +1,4 @@
+/* exported containerProfileMap audioCodecMap AudioProfile */
 /*
  * Copyright 2013 Meg Ford
  * This library is free software; you can redistribute it and/or
@@ -35,7 +36,7 @@ const comboBoxMap = {
     MP4: 4
 };
 
-const containerProfileMap = {
+var containerProfileMap = {
     OGG: "application/ogg",
     ID3: "application/x-id3",
     MP4: "video/quicktime,variant=(string)iso",
@@ -43,7 +44,7 @@ const containerProfileMap = {
 };
 
 
-const audioCodecMap = {
+var audioCodecMap = {
     FLAC: "audio/x-flac",
     MP3: "audio/mpeg,mpegversion=(int)1,layer=(int)3",
     MP4: "audio/mpeg,mpegversion=(int)4",
@@ -51,8 +52,7 @@ const audioCodecMap = {
     VORBIS: "audio/x-vorbis"
 };
 
-
-const AudioProfile = new Lang.Class({
+var AudioProfile = new Lang.Class({
     Name: 'AudioProfile',
 
     profile: function(profileName){
diff --git a/src/fileUtil.js b/src/fileUtil.js
index f4364ef..d015474 100644
--- a/src/fileUtil.js
+++ b/src/fileUtil.js
@@ -1,3 +1,4 @@
+/* exported OffsetController DisplayTime */
 /*
  * Copyright 2013 Meg Ford
  * This library is free software; you can redistribute it and/or
@@ -35,7 +36,7 @@ const _OFFSET_STEP = 20;
 let CurrentEndIdx;
 let totItems;
 
-const OffsetController = new Lang.Class({
+var OffsetController = new Lang.Class({
     Name: 'OffsetController',
 
     _init: function(context) {
@@ -69,7 +70,7 @@ const OffsetController = new Lang.Class({
     }
 });
 
-const DisplayTime = new Lang.Class({
+var DisplayTime = new Lang.Class({
     Name: 'DisplayTime',
 
     getDisplayTime: function(mtime) {
diff --git a/src/info.js b/src/info.js
index 5a4e298..5c52219 100644
--- a/src/info.js
+++ b/src/info.js
@@ -1,3 +1,4 @@
+/* exported InfoDialog */
 /*
  * Copyright 2013 Meg Ford
  * This library is free software; you can redistribute it and/or
@@ -28,7 +29,7 @@ const C_ = imports.gettext.pgettext;
 
 const MainWindow = imports.mainWindow;
 
-const InfoDialog = new Lang.Class({
+var InfoDialog = new Lang.Class({
     Name: 'InfoDialog',
 
     _init: function(fileNav) {
diff --git a/src/listview.js b/src/listview.js
index afe508a..f86b7a3 100644
--- a/src/listview.js
+++ b/src/listview.js
@@ -1,3 +1,4 @@
+/* exported Listview */
 /*
  * Copyright 2013 Meg Ford
  * This library is free software; you can redistribute it and/or
@@ -62,7 +63,7 @@ let startRecording = false;
 let stopVal = null;
 var trackNumber = 0;
 
-const Listview = new Lang.Class({
+var Listview = new Lang.Class({
     Name: "Listview",
 
     _init: function() {
diff --git a/src/mainWindow.js b/src/mainWindow.js
index a6766b4..83ce2c7 100644
--- a/src/mainWindow.js
+++ b/src/mainWindow.js
@@ -1,3 +1,7 @@
+/* exported audioProfile displayTime list offsetController
+            play recordPipeline view volumeValue wave ActiveArea
+            RecordPipelineStates _SEC_TIMEOUT MainWindow
+            EncoderComboBox ChannelsComboBox */
 /*
 * Copyright 2013 Meg Ford
 * This library is free software; you can redistribute it and/or
@@ -40,27 +44,27 @@ const Record = imports.record;
 const Waveform = imports.waveform;
 
 let activeProfile = null;
-let audioProfile = null;
-let displayTime = null;
+var audioProfile = null;
+var displayTime = null;
 let grid = null;
 let groupGrid;
 let header;
-let list = null;
+var list = null;
 let loadMoreButton = null;
-let offsetController = null;
-let play = null;
+var offsetController = null;
+var play = null;
 let previousSelRow = null;
-let recordPipeline = null;
+var recordPipeline = null;
 let recordButton = null;
 let appMenuButton = null;
 let selectable = null;
 let setVisibleID = null;
 let UpperBoundVal = 182;
-let view = null;
-let volumeValue = [];
-let wave = null;
+var view = null;
+var volumeValue = [];
+var wave = null;
 
-const ActiveArea = {
+var ActiveArea = {
     RECORD: 0,
     PLAY: 1
 };
@@ -76,16 +80,16 @@ const PipelineStates = {
     STOPPED: 2
 };
 
-const RecordPipelineStates = {
+var RecordPipelineStates = {
     PLAYING: 0,
     PAUSED: 1,
     STOPPED: 2
 };
 
 const _TIME_DIVISOR = 60;
-const _SEC_TIMEOUT = 100;
+var _SEC_TIMEOUT = 100;
 
-const MainWindow = new Lang.Class({
+var MainWindow = new Lang.Class({
     Name: 'MainWindow',
     Extends: Gtk.ApplicationWindow,
 
@@ -831,7 +835,7 @@ const RecordButton = new Lang.Class({
     }
 });
 
-const EncoderComboBox = new Lang.Class({
+var EncoderComboBox = new Lang.Class({
     Name: "EncoderComboBox",
     Extends: Gtk.ComboBoxText,
 
@@ -855,7 +859,7 @@ const EncoderComboBox = new Lang.Class({
     }
 });
 
-const ChannelsComboBox = new Lang.Class({
+var ChannelsComboBox = new Lang.Class({
     Name: "ChannelsComboBox",
     Extends: Gtk.ComboBoxText,
 
diff --git a/src/play.js b/src/play.js
index e20dd4e..d46fff7 100644
--- a/src/play.js
+++ b/src/play.js
@@ -1,3 +1,4 @@
+/* exported Play */
 /*
  * Copyright 2013 Meg Ford
  * This library is free software; you can redistribute it and/or
@@ -47,7 +48,7 @@ let errorDialogState;
 
 const _TENTH_SEC = 100000000;
 
-const Play = new Lang.Class({
+var Play = new Lang.Class({
     Name: "Play",
 
     _playPipeline: function() {
diff --git a/src/preferences.js b/src/preferences.js
index 800902f..4d6ec91 100644
--- a/src/preferences.js
+++ b/src/preferences.js
@@ -1,3 +1,4 @@
+/* exported Preferences */
 /*
 * Copyright 2013 Meg Ford
 * This library is free software; you can redistribute it and/or
@@ -33,7 +34,7 @@ let channelsComboBoxText = null;
 let recordVolume= null;
 let playVolume = null;
 
-const Preferences = new Lang.Class({
+var Preferences = new Lang.Class({
     Name: 'Preferences',
     
      _init: function() {    
diff --git a/src/record.js b/src/record.js
index 73de73b..765c5b6 100644
--- a/src/record.js
+++ b/src/record.js
@@ -1,3 +1,4 @@
+/* exported Record */
 /*
  * Copyright 2013 Meg Ford
  * This library is free software; you can redistribute it and/or
@@ -55,7 +56,7 @@ const _TENTH_SEC = 100000000;
 
 let errorDialogState;
 
-const Record = new Lang.Class({
+var Record = new Lang.Class({
     Name: "Record",
 
     _recordPipeline: function() {
diff --git a/src/waveform.js b/src/waveform.js
index ca7e2cc..4161919 100644
--- a/src/waveform.js
+++ b/src/waveform.js
@@ -1,3 +1,4 @@
+/* exported WaveForm */
 /*
 * Copyright 2013 Meg Ford
 * This library is free software; you can redistribute it and/or
@@ -45,7 +46,7 @@ const WaveType = {
     PLAY: 1
 };
 
-const WaveForm = new Lang.Class({
+var WaveForm = new Lang.Class({
     Name: 'WaveForm',
 
     _init: function(grid, file) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]