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
This commit is contained in:
Colin Walters 2010-09-24 13:55:12 -04:00 committed by Owen W. Taylor
parent 11db188fe9
commit e22fbda689

View File

@ -17,13 +17,13 @@ function makeProxyClass(iface) {
} }
function nameToPath(name) { function nameToPath(name) {
return '/' + name.replace('.', '/', 'g'); return '/' + name.replace(/\./g, '/');
}; };
function pathToName(path) { function pathToName(path) {
if (path[0] != '/') if (path[0] != '/')
throw new Error('not a D-Bus path: ' + path); 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 // This is tp_escape_as_identifier() from telepathy-glib