Skip to content

Commit

Permalink
Add object.keys if it's not found
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jun 23, 2011
1 parent 7f3b3b4 commit 041b033
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions registry/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,10 @@ ddoc.rewrites =
]

ddoc.lists.short = function (head, req) {
Object.keys = Object.keys
|| function (o) { var a = []
for (var i in o) a.push(i)
return a }
var out = {}
, row
, show = (req.query.show || "").split(",")
Expand Down Expand Up @@ -331,6 +335,10 @@ ddoc.lists.preBuilt = function (head, req) {

ddoc.views.needBuild = {
map : function (doc) {
Object.keys = Object.keys
|| function (o) { var a = []
for (var i in o) a.push(i)
return a }
if (!doc || !doc.versions || !doc["dist-tags"]) return
var v = doc["dist-tags"].latest
//Object.keys(doc.versions).forEach(function (v) {
Expand Down Expand Up @@ -408,6 +416,10 @@ ddoc.views.nodeWafInstall = {

ddoc.views.badBins = {
map : function (doc) {
Object.keys = Object.keys
|| function (o) { var a = []
for (var i in o) a.push(i)
return a }
if (!doc || !doc.versions || !doc["dist-tags"]) return
var v = doc["dist-tags"].latest
if (!doc.versions[v]) return
Expand Down Expand Up @@ -551,6 +563,10 @@ ddoc.lists.size = function (head, req) {
}

ddoc.lists.histogram = function (head, req) {
Object.keys = Object.keys
|| function (o) { var a = []
for (var i in o) a.push(i)
return a }
start({"code": 200, "headers": {"Content-Type": "text/plain"}});
var row
, out = []
Expand Down

0 comments on commit 041b033

Please sign in to comment.