[gnome-shell] telepathy: Use string.replace in a way compatible with newer Spidermonkey



commit e22fbda689153570b8fbaee3dfbe2a583c53ed98
Author: Colin Walters <walters verbum org>
Date:   Fri Sep 24 13:55:12 2010 -0400

    telepathy: Use string.replace in a way compatible with newer Spidermonkey
    
    The semantics of the first argument changed from literal -> regexp
    if the 'g' option was specified.  To remove ambiguity, stop using
    the spidermonkey extension and create a standard RegExp object.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=630539

 js/misc/telepathy.js |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/js/misc/telepathy.js b/js/misc/telepathy.js
index e4d1a7a..c1443fb 100644
--- a/js/misc/telepathy.js
+++ b/js/misc/telepathy.js
@@ -17,13 +17,13 @@ function makeProxyClass(iface) {
 }
 
 function nameToPath(name) {
-    return '/' + name.replace('.', '/', 'g');
+    return '/' + name.replace(/\./g, '/');
 };
 
 function pathToName(path) {
     if (path[0] != '/')
         throw new Error('not a D-Bus path: ' + path);
-    return path.substr(1).replace('/', '.', 'g');
+    return path.substr(1).replace(/\//g, '.');
 };
 
 // This is tp_escape_as_identifier() from telepathy-glib



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