我试过这样做:
var r = {};
for (p in Packages) {
if (Packages.hasOwnProperty(p)) {
r[p] = p.toString();
}
}
...但我得到一个错误:
TypeError: Invalid iterator value ... at line xx
错误消息中指示的行是带有
for (p in Packages) { ... }
还,
var r = {
"Packages" : typeof Packages,
"Packages.length" : typeof Packages.length,
"Packages.java" : typeof Packages.java,
"Packages.surelyThisIsNotDefined" : typeof Packages.surelyThisIsNotDefined
};
结果是:
{
"Packages": "object",
"Packages.length": "object",
"Packages.java": "object",
"Packages.surelyThisIsNotDefined": "object"
}
...这根本没有帮助。