diff options
author | Doug Kearns <dougkearns@gmail.com> | 2015-06-18 18:20:48 +1000 |
---|---|---|
committer | Doug Kearns <dougkearns@gmail.com> | 2015-06-18 18:20:48 +1000 |
commit | d3cb216478807b7eeb898d14117fea3958c74f4d (patch) | |
tree | 170051aa2c1c11a0d163304036dc98021b8d65b4 /common | |
parent | cd7a8eeda9b8170f9174d1536f9bca46a653c52a (diff) | |
download | pentadactyl-d3cb216478807b7eeb898d14117fea3958c74f4d.tar.gz |
Make isinstance() and template.highlight Symbol aware.
Diffstat (limited to 'common')
-rw-r--r-- | common/modules/base.jsm | 3 | ||||
-rw-r--r-- | common/modules/template.jsm | 7 | ||||
-rw-r--r-- | common/skin/global-styles.css | 1 |
3 files changed, 7 insertions, 4 deletions
diff --git a/common/modules/base.jsm b/common/modules/base.jsm index 763014ee..04bda50d 100644 --- a/common/modules/base.jsm +++ b/common/modules/base.jsm @@ -646,7 +646,8 @@ var isinstance_types = { boolean: Boolean, string: String, function: Function, - number: Number + number: Number, + symbol: Symbol }; function isinstance(object, interfaces) { if (object == null) diff --git a/common/modules/template.jsm b/common/modules/template.jsm index 65cad529..124175ec 100644 --- a/common/modules/template.jsm +++ b/common/modules/template.jsm @@ -284,10 +284,13 @@ var Template = Module("Template", { if (processStrings) str = JSON.stringify(str); return ["span", { highlight: "String" }, str]; + case "symbol": + return ["span", { highlight: "Symbol" }, str]; case "boolean": return ["span", { highlight: "Boolean" }, str]; case "function": - if (arg instanceof Ci.nsIDOMElement) // wtf? + // See: https://bugzil.la/268945 + if (arg instanceof Ci.nsIDOMElement) return util.objectToString(arg, !bw); str = str.replace("/* use strict */ \n", "/* use strict */ "); @@ -310,8 +313,6 @@ var Template = Module("Template", { { highlight: "NonText" }, "^J"]); return ["span", { highlight: "Object" }, str]; - case "xml": - return arg; default: return "<unknown type>"; } diff --git a/common/skin/global-styles.css b/common/skin/global-styles.css index b09f4022..b545b88e 100644 --- a/common/skin/global-styles.css +++ b/common/skin/global-styles.css @@ -4,6 +4,7 @@ Null /* JavaScript null values */ color: blue; Number /* JavaScript numbers */ color: blue; Object /* JavaScript objects */ color: maroon; String /* String values */ color: green; white-space: pre; +Symbol /* JavaScript symbols */ color: darkcyan; Comment /* JavaScriptor CSS comments */ color: gray; Key /* Keywords */ font-weight: bold; |