mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-26 04:22:28 +01:00
Make isinstance() and template.highlight Symbol aware.
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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>";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user