I am actually new to both spider monkey api and this mailing list. Actually I was trying to create a Array like objectA.arrayA and the call back code goes like this.
char *value[] = {"abc", "xyz", "efg"};
int count = 0;
JSObject* val = JS_NewArrayObject(pContext, 0, NULL);
while(count < 3) {
jstr = JS_NewStringCopyZ(pContext, value[count]);
JS_DefineElement(pContext, val, count++, STRING_TO_JSVAL(jstr),
NULL, NULL, JSPROP_ENUMERATE | JSPROP_READONLY | JSPROP_PERMANENT);
}
vJs->DefineProperty(pObject, "arrayA", OBJECT_TO_JSVAL(val));
I am getting the proper value for the objectA.arrayA but when I do objectA.arrayA.length, it says arrayA does not have ay property. Can you tell what i am doing wrong. I am facing the same even when I am creating a sting.