aboutsummaryrefslogtreecommitdiffstats
path: root/lib/util.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-07-20 12:22:10 +0200
committerMatěj Cepl <mcepl@redhat.com>2010-07-20 12:22:10 +0200
commit0b74818ba503207595d56fa91c70ba3e83a481af (patch)
tree2b9bc1ebb709e76b369cd225611a440f7d919eb8 /lib/util.js
parent5405da4f392988c0d396afd33be049ae64045c63 (diff)
downloadbugzilla-triage-0b74818ba503207595d56fa91c70ba3e83a481af.tar.gz
Add util.getObjectKeys for better diagnostic.
Diffstat (limited to 'lib/util.js')
-rw-r--r--lib/util.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/lib/util.js b/lib/util.js
index 4648ee9..4f3964e 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -1,4 +1,4 @@
-/*global exports: false, require: false, console: false */
+/*global exports: false, require: false, console: false, Cc: false, Ci: false */
/*jslint onevar: false */
// Released under the MIT/X11 license
// http://www.opensource.org/licenses/mit-license.php
@@ -28,12 +28,11 @@ var {Cc,Ci} = require("chrome");
* </pre>
*/
exports.heir = function heir(p) {
- function f() {};
- f.prototype = p.prototype;
- return new f();
+ function F() {};
+ F.prototype = p.prototype;
+ return new F();
};
-
exports.getBugNo = function getBugNo(url) {
var re = new RegExp(".*id=([0-9]+).*$");
var bugNo = null;
@@ -187,3 +186,13 @@ var filterByRegexp = exports.filterByRegexp =
return "";
}
};
+
+exports.getObjectKeys = function getObjectKeys(obj) {
+ var keys = [];
+ for (var key in obj) {
+ if (obj.hasOwnProperty(key)) {
+ keys.push(key);
+ }
+ }
+ return keys;
+}; \ No newline at end of file