What is wrong in the script?

Hi experts,

Below is the script:

function getDep(device)
{
var p = new Array();
var c = new Array();
var d = new Array();
var t = new Array();
var o = new Array();
p=FindParentCIs(device);

c=FindChildCIs(device);
o = "The record has been updated by" vars.$lo_user_name;
t = "at" system.functions.tod();
d = (p.concat( c,o,t));
return(d);
}


While execution its giving following error:

Script 'test' line 123: ERROR TypeError: p has no properties at char 1

Cannot evaluate expression (format.ccal,calc.calculations)