Changeset 328 for trunk/zoo-project/zoo-kernel/service_internal_js.c
- Timestamp:
- Aug 26, 2011, 3:53:26 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/zoo-project/zoo-kernel/service_internal_js.c
r287 r328 77 77 78 78 /* Create the global object. */ 79 //global = JS_NewCompartmentAndGlobalObject(cx, &global_class, NULL); 80 global = JS_NewObject(cx, &global_class, NULL,NULL); 79 //#ifdef JS_NewCompartmentAndGlobalObject 80 global = JS_NewCompartmentAndGlobalObject(cx, &global_class, NULL); 81 //#else 82 //global = JS_NewObject(cx, &global_class, NULL,NULL); 83 //#endif 81 84 82 85 /* Populate the global object with the standard globals, … … 284 287 285 288 JSObject* JSObject_FromMaps(JSContext *cx,maps* t){ 286 JSObject *res = JS_NewArrayObject(cx, 0, NULL); 289 290 JSObject* res=JS_NewObject(cx, NULL, NULL, NULL); 291 //JSObject *res = JS_NewArrayObject(cx, 0, NULL); 287 292 if(res==NULL) 288 293 fprintf(stderr,"Array Object is NULL!\n"); 289 294 maps* tmp=t; 295 290 296 while(tmp!=NULL){ 291 297 jsuint len; … … 293 299 JSObject *pval=JSObject_FromMap(cx,tmp->content); 294 300 jsval pvalj=OBJECT_TO_JSVAL(pval); 295 JS_SetProperty(cx, res1, tmp->name, &pvalj); 296 JS_GetArrayLength(cx, res, &len); 297 jsval res1j = OBJECT_TO_JSVAL(res1); 298 JS_SetElement(cx,res,len,&res1j); 301 JS_SetProperty(cx, res, tmp->name, &pvalj); 302 299 303 #ifdef JS_DEBUG 300 304 fprintf(stderr,"Length of the Array %d, element : %s added \n",len,tmp->name);
Note: See TracChangeset
for help on using the changeset viewer.