Ignore:
Timestamp:
Apr 3, 2013, 7:31:35 PM (7 years ago)
Author:
djay
Message:

Fix for JavaScript? support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/zoo-project/zoo-kernel/service_internal_js.c

    r403 r410  
    410410    fprintf(stderr,"tmap is not null ! (%s = %s)\n",tmap->name,tmap->value);
    411411#endif
    412   if(isArray==NULL){
    413     while(tmpm!=NULL){
    414       jsval jsstr;
    415       if(isBinary!=NULL && strncasecmp(tmpm->name,"value",5)==0)
    416         jsstr = STRING_TO_JSVAL(JS_NewStringCopyN(cx,tmpm->value,atoi(isBinary->value)));
    417       else
    418         jsstr = STRING_TO_JSVAL(JS_NewStringCopyN(cx,tmpm->value,strlen(tmpm->value)));
    419       JS_SetProperty(cx, res, tmpm->name,&jsstr);
    420 #ifdef JS_DEBUG
    421       fprintf(stderr,"[JS] %s => %s\n",tmpm->name,tmpm->value);
    422 #endif
    423       tmpm=tmpm->next;
    424     }
    425   }
    426   else{
     412  while(tmpm!=NULL){
     413    jsval jsstr;
     414    if((isArray==NULL && isBinary!=NULL && strncasecmp(tmpm->name,"value",5)==0))
     415      jsstr = STRING_TO_JSVAL(JS_NewStringCopyN(cx,tmpm->value,atoi(isBinary->value)));
     416    else
     417      jsstr = STRING_TO_JSVAL(JS_NewStringCopyN(cx,tmpm->value,strlen(tmpm->value)));
     418    JS_SetProperty(cx, res, tmpm->name,&jsstr);
     419#ifdef JS_DEBUG
     420    fprintf(stderr,"[JS] %s => %s\n",tmpm->name,tmpm->value);
     421#endif
     422    tmpm=tmpm->next;
     423  }
     424  if(isArray!=NULL){
    427425    map* len=getMap(t,"length");
    428426    int cnt=atoi(len->value);
Note: See TracChangeset for help on using the changeset viewer.

Search

Context Navigation

ZOO Sponsors

http://www.zoo-project.org/trac/chrome/site/img/geolabs-logo.pnghttp://www.zoo-project.org/trac/chrome/site/img/neogeo-logo.png http://www.zoo-project.org/trac/chrome/site/img/apptech-logo.png http://www.zoo-project.org/trac/chrome/site/img/3liz-logo.png http://www.zoo-project.org/trac/chrome/site/img/gateway-logo.png

Become a sponsor !

Knowledge partners

http://www.zoo-project.org/trac/chrome/site/img/ocu-logo.png http://www.zoo-project.org/trac/chrome/site/img/gucas-logo.png http://www.zoo-project.org/trac/chrome/site/img/polimi-logo.png http://www.zoo-project.org/trac/chrome/site/img/fem-logo.png http://www.zoo-project.org/trac/chrome/site/img/supsi-logo.png http://www.zoo-project.org/trac/chrome/site/img/cumtb-logo.png

Become a knowledge partner

Related links

http://zoo-project.org/img/ogclogo.png http://zoo-project.org/img/osgeologo.png