[polari] telepathyClient: Replace non-standard replace parameter



commit d852d071244d0e233c678dc1560054210b66cc1b
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Jul 19 02:56:46 2017 +0200

    telepathyClient: Replace non-standard replace parameter
    
    String.replace only supports two parameters according to the standard.
    Mozilla removed the non-standard flags parameter in version 47, so the
    replacement is no longer global as intended, but only applies to the
    first match. Luckily this is all we actually need in this case, but
    let's still fix the code to do what it suggests.

 src/telepathyClient.js |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/telepathyClient.js b/src/telepathyClient.js
index 710c07f..ccf20d9 100644
--- a/src/telepathyClient.js
+++ b/src/telepathyClient.js
@@ -232,7 +232,7 @@ var TelepathyClient = new Lang.Class({
 
     _setAccountPresence: function(account, presence) {
         let statuses = Object.keys(Tp.ConnectionPresenceType).map(s =>
-            s.replace('_', '-', 'g').toLowerCase()
+            s.replace(/_/g, '-').toLowerCase()
         );
         let status = statuses[presence];
         let msg = account.requested_status_message;


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