зеркало из https://github.com/mozilla/pjs.git
Bug 351215 - instanceof now failing for subscript loader generated objects
p=silver@warwickcompsoc.co.uk (James Ross) r=ssieb ChatZilla Only
This commit is contained in:
Родитель
b2d8418382
Коммит
aedb529bd0
|
@ -121,7 +121,7 @@ function futils_nosepicker(initialPath, typeList, attribs)
|
|||
}
|
||||
else
|
||||
{
|
||||
if (!(initialPath instanceof nsILocalFile))
|
||||
if (!isinstance(initialPath, nsILocalFile))
|
||||
throw "bad type for argument |initialPath|";
|
||||
|
||||
localFile = initialPath;
|
||||
|
@ -135,7 +135,7 @@ function futils_nosepicker(initialPath, typeList, attribs)
|
|||
if (typeof typeList == "string")
|
||||
typeList = typeList.split(" ");
|
||||
|
||||
if (typeList instanceof Array)
|
||||
if (isinstance(typeList, Array))
|
||||
{
|
||||
for (var i in typeList)
|
||||
{
|
||||
|
@ -330,7 +330,7 @@ function LocalFile(file, mode, perms, tmp)
|
|||
{
|
||||
this.localFile = new nsLocalFile(file);
|
||||
}
|
||||
else if (file instanceof nsILocalFile)
|
||||
else if (isinstance(file, nsILocalFile))
|
||||
{
|
||||
this.localFile = file;
|
||||
}
|
||||
|
|
|
@ -263,7 +263,7 @@ function mmgr_showpop (event)
|
|||
// Get the array of new items to add.
|
||||
var ary = evalAttribute(menuitem, "repeatfor");
|
||||
|
||||
if ((typeof ary != "object") || !(ary instanceof Array))
|
||||
if ((typeof ary != "object") || !isinstance(ary, Array))
|
||||
ary = [];
|
||||
|
||||
/* The item itself should only be shown if there's no items in the
|
||||
|
|
|
@ -294,7 +294,7 @@ function pm_arrayupdate(prefName)
|
|||
if (record.realValue == null)
|
||||
record.realValue = record.defaultValue;
|
||||
|
||||
if (!ASSERT(record.realValue instanceof Array, "Pref is not an array"))
|
||||
if (!ASSERT(isinstance(record.realValue, Array), "Pref is not an array"))
|
||||
return;
|
||||
|
||||
this.prefBranch.setCharPref(prefName, this.arrayToString(record.realValue));
|
||||
|
@ -362,7 +362,7 @@ function pm_getpref(prefName, reload)
|
|||
{
|
||||
realValue = this.prefBranch.getIntPref(prefName);
|
||||
}
|
||||
else if (defaultValue instanceof Array)
|
||||
else if (isinstance(defaultValue, Array))
|
||||
{
|
||||
realValue = this.prefBranch.getCharPref(prefName);
|
||||
realValue = this.stringToArray(realValue);
|
||||
|
@ -425,7 +425,7 @@ function pm_setpref(prefName, value)
|
|||
{
|
||||
this.prefBranch.setIntPref(prefName, value);
|
||||
}
|
||||
else if (defaultValue instanceof Array)
|
||||
else if (isinstance(defaultValue, Array))
|
||||
{
|
||||
var str = this.arrayToString(value);
|
||||
this.prefBranch.setCharPref(prefName, str);
|
||||
|
@ -474,7 +474,7 @@ function pm_addpref(prefName, defaultValue, setter, bundle, group)
|
|||
if (!setter)
|
||||
setter = prefSetter;
|
||||
|
||||
if (defaultValue instanceof Array)
|
||||
if (isinstance(defaultValue, Array))
|
||||
defaultValue.update = updateArrayPref;
|
||||
|
||||
var label = getMsgFrom(bundle, "pref." + prefName + ".label", null, prefName);
|
||||
|
|
|
@ -166,7 +166,7 @@ function ts_serialize(obj)
|
|||
break;
|
||||
|
||||
case "function":
|
||||
if (o[p] instanceof RegExp)
|
||||
if (isinstance(o[p], RegExp))
|
||||
writeProp(p, ecmaEscape("" + o[p]));
|
||||
// Can't serialize non-RegExp functions (yet).
|
||||
break;
|
||||
|
@ -180,7 +180,7 @@ function ts_serialize(obj)
|
|||
else
|
||||
{
|
||||
var className = "";
|
||||
if (o[p] instanceof Array)
|
||||
if (isinstance(o[p], Array))
|
||||
className = "<Array> ";
|
||||
|
||||
me._fileStream.write(indent + "START " + className +
|
||||
|
@ -196,7 +196,7 @@ function ts_serialize(obj)
|
|||
}
|
||||
};
|
||||
|
||||
if (obj instanceof Array)
|
||||
if (isinstance(obj, Array))
|
||||
this._fileStream.write("START <Array>" + this.lineEnd);
|
||||
else
|
||||
this._fileStream.write("START" + this.lineEnd);
|
||||
|
@ -276,7 +276,7 @@ function ts_deserialize()
|
|||
/* Create a new object level, but with no name. This is
|
||||
* only valid if the parent level is an array.
|
||||
*/
|
||||
if (!ASSERT(obj instanceof Array, "Parent not Array!"))
|
||||
if (!ASSERT(isinstance(obj, Array), "Parent not Array!"))
|
||||
return null;
|
||||
if (className)
|
||||
n = new window[className]();
|
||||
|
|
|
@ -389,7 +389,7 @@ function matchObject (o, pattern, negate)
|
|||
|
||||
function _match (o, pattern)
|
||||
{
|
||||
if (pattern instanceof Function)
|
||||
if (isinstance(pattern, Function))
|
||||
return pattern(o);
|
||||
|
||||
for (p in pattern)
|
||||
|
@ -405,7 +405,7 @@ function matchObject (o, pattern, negate)
|
|||
*/
|
||||
val = o[p];
|
||||
|
||||
if (pattern[p] instanceof Function)
|
||||
if (isinstance(pattern[p], Function))
|
||||
{
|
||||
if (!pattern[p](val))
|
||||
return false;
|
||||
|
@ -424,7 +424,7 @@ function matchObject (o, pattern, negate)
|
|||
|
||||
}
|
||||
|
||||
if (!(pattern instanceof Array))
|
||||
if (!isinstance(pattern, Array))
|
||||
return Boolean (negate ^ _match(o, pattern));
|
||||
|
||||
for (var i in pattern)
|
||||
|
|
|
@ -518,7 +518,7 @@ function PrefData(parent, name)
|
|||
|
||||
// And those arrays... this just makes our life easier later by having
|
||||
// a particular name for array prefs.
|
||||
if (this.def instanceof Array)
|
||||
if (isinstance(this.def, Array))
|
||||
this.type = "array";
|
||||
|
||||
if (this.group == "hidden")
|
||||
|
|
|
@ -1313,7 +1313,7 @@ function my_list(word, file)
|
|||
this._list.file = new LocalFile(lfile.localFile, ">");
|
||||
}
|
||||
|
||||
if (word instanceof RegExp)
|
||||
if (isinstance(word, RegExp))
|
||||
{
|
||||
this._list.regexp = word;
|
||||
this._list.string = "";
|
||||
|
|
|
@ -98,7 +98,7 @@ function initNetworks()
|
|||
if (networksLoader.open("<"))
|
||||
{
|
||||
var item = networksLoader.deserialize();
|
||||
if (item instanceof Array)
|
||||
if (isinstance(item, Array))
|
||||
userNetworkList = item;
|
||||
else
|
||||
dd("Malformed networks file!");
|
||||
|
|
|
@ -372,7 +372,7 @@ function initStatic()
|
|||
{
|
||||
// Load the first item from the file.
|
||||
var item = awayLoader.deserialize();
|
||||
if (item instanceof Array)
|
||||
if (isinstance(item, Array))
|
||||
{
|
||||
// If the first item is an array, it is the entire thing.
|
||||
client.awayMsgs = item;
|
||||
|
@ -1959,7 +1959,7 @@ function findDynamicRule (selector)
|
|||
{
|
||||
var rules = frames[0].document.styleSheets[1].cssRules;
|
||||
|
||||
if (selector instanceof RegExp)
|
||||
if (isinstance(selector, RegExp))
|
||||
fun = "search";
|
||||
else
|
||||
fun = "indexOf";
|
||||
|
@ -3473,7 +3473,7 @@ function cli_connect(networkOrName, requireSecurity)
|
|||
var name;
|
||||
|
||||
|
||||
if (networkOrName instanceof CIRCNetwork)
|
||||
if (isinstance(networkOrName, CIRCNetwork))
|
||||
{
|
||||
network = networkOrName;
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ function CMungerEntry (name, regex, className, enable, tagName)
|
|||
this.enabledDefault = this.enabled;
|
||||
this.tagName = (tagName) ? tagName : "html:span";
|
||||
|
||||
if (regex instanceof RegExp)
|
||||
if (isinstance(regex, RegExp))
|
||||
this.regex = regex;
|
||||
else
|
||||
this.lambdaMatch = regex;
|
||||
|
|
|
@ -718,7 +718,7 @@ function xtvr_rkids (always)
|
|||
XULTreeViewRecord.prototype.appendChild =
|
||||
function xtvr_appchild (child)
|
||||
{
|
||||
if (!(child instanceof XULTreeViewRecord))
|
||||
if (!isinstance(child, XULTreeViewRecord))
|
||||
throw Components.results.NS_ERROR_INVALID_ARG;
|
||||
|
||||
child.isHidden = false;
|
||||
|
|
Загрузка…
Ссылка в новой задаче