From e90c3f9e49a40eaa7ee3602cf55f89c8d2762088 Mon Sep 17 00:00:00 2001 From: mcmlxxix <> Date: Fri, 18 Nov 2011 00:35:46 +0000 Subject: [PATCH] actually make the changes mentioned in the previous commit :| --- exec/load/json-db.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/exec/load/json-db.js b/exec/load/json-db.js index af89b005a7..fd3d375dbb 100644 --- a/exec/load/json-db.js +++ b/exec/load/json-db.js @@ -236,7 +236,7 @@ function JSONdb (fileName) { /* if this client has this record locked */ else if(record.info.lock[client.id] && record.info.lock[client.id].type == locks.WRITE) { - if(typeof record.data[record.child_name].pop == "function") + if(record.data[record.child_name] instanceof Array) { send_packet(client,record.data[record.child_name].pop(),"RESPONSE"); else this.error(client,errors.NON_ARRAY); @@ -258,7 +258,7 @@ function JSONdb (fileName) { /* if this client has this record locked */ else if(record.info.lock[client.id] && record.info.lock[client.id].type == locks.WRITE) { - if(typeof record.data[record.child_name].shift == "function") + if(record.data[record.child_name] instanceof Array) { send_packet(client,record.data[record.child_name].shift(),"RESPONSE"); else this.error(client,errors.NON_ARRAY); @@ -280,7 +280,7 @@ function JSONdb (fileName) { /* if this client has this record locked */ else if(record.info.lock[client.id] && record.info.lock[client.id].type == locks.WRITE) { - if(typeof record.data[record.child_name].pop == "function") { + if(record.data[record.child_name] instanceof Array) { var index = record.data[record.child_name].length; record.data[record.child_name].push(data); /* populate this object's children with shadow objects */ @@ -306,7 +306,7 @@ function JSONdb (fileName) { /* if this client has this record locked */ else if(record.info.lock[client.id] && record.info.lock[client.id].type == locks.WRITE) { - if(typeof record.data[record.child_name].unshift == "function") { + if(record.data[record.child_name] instanceof Array) { var index = record.data[record.child_name].length; record.data[record.child_name].unshift(data); /* populate this object's children with shadow objects */ -- GitLab