From 07ce31976314ce2bd1f7fcbb613e373663a7cf51 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Thu, 14 May 2015 03:02:30 +1000 Subject: [PATCH] Remove straggling String#quote usage. String#quote is no more. Fixes :mkvimruntime. --- common/content/mappings.js | 2 +- common/modules/base.jsm | 6 +++--- common/modules/io.jsm | 2 +- common/modules/util.jsm | 3 +-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/common/content/mappings.js b/common/content/mappings.js index 6e5d76e5..0a722fd1 100644 --- a/common/content/mappings.js +++ b/common/content/mappings.js @@ -51,7 +51,7 @@ var Map = Class("Map", { names: Class.Memoize(function () this._keys.map(k => DOM.Event.canonicalKeys(k))), get toStringParams() [this.modes.map(m => m.name), - this.names.map(String.quote)], + this.names.map(JSON.stringify)], get identifier() [this.modes[0].name, this.hive.prefix + this.names[0]].join("."), diff --git a/common/modules/base.jsm b/common/modules/base.jsm index 0d1b97a8..6e67abd2 100644 --- a/common/modules/base.jsm +++ b/common/modules/base.jsm @@ -141,7 +141,7 @@ function require_(obj, name, from, targetName) { return obj; } catch (e) { - defineModule.dump("loading " + String.quote(name + ".jsm") + "\n"); + defineModule.dump("loading " + JSON.stringify(name + ".jsm") + "\n"); if (loaded.util) util.reportError(e); else @@ -291,9 +291,9 @@ function* properties(obj, prototypes) { } catch (e) { util.reportError("Filtering properties for " + - String.quote(obj) + ", " + + JSON.stringify(obj) + ", " + "error checking presence of " + - String.quote(prop) + ": " + e); + JSON.stringify(prop) + ": " + e); } return false; }; diff --git a/common/modules/io.jsm b/common/modules/io.jsm index 9c23de28..95d242cd 100644 --- a/common/modules/io.jsm +++ b/common/modules/io.jsm @@ -868,7 +868,7 @@ unlet s:cpo_save Ary(o.names for (o of options) if (o.type != "boolean")).flatten()), toggleoptions: wrap("let s:toggleOptions = [", Ary(o.realNames for (o of options) if (o.type == "boolean")) - .flatten().map(String.quote), + .flatten().map(JSON.stringify), ", ") + "]" }; //}}} diff --git a/common/modules/util.jsm b/common/modules/util.jsm index b700c9db..8b61b985 100644 --- a/common/modules/util.jsm +++ b/common/modules/util.jsm @@ -390,7 +390,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), let quote = util.identity; if (flags.has("q")) - quote = function quote(obj) typeof obj === "number" ? obj : String.quote(obj); + quote = function quote(obj) typeof obj === "number" ? obj : JSON.stringify(obj); if (flags.has("e")) quote = function quote(obj) ""; @@ -596,7 +596,6 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), /** * Escapes quotes, newline and tab characters in *str*. The returned string * is delimited by *delimiter* or " if *delimiter* is not specified. - * {@see String#quote}. * * @param {string} str * @param {string} delimiter