Subj : Re: Using Return value in another script problem To : Laurent Marzullo From : Brendan Eich Date : Wed Jun 02 2004 10:53 pm Laurent Marzullo wrote: > Here what I'm doing in the method: > > 1) Calling a CORBA Service to retrieve structure information from > a data base (The structure and value contained are correct). > 2) Creating a PrtNameAttr object. > o = JS_ConstructObject( cx , &PrtyNameAttrClass , 0 , 0 ); > if ( o == 0 ) > std::cerr << " (Error)\n"; > else > std::cerr << " (done)\n"; > 3) I then defining a property for every field in the structure. > > JS_DefineProperty( cx , o , "frnm" , > STRING_TO_JSVAL( > JS_NewString( cx , frnm, strlen( frnm ) ) ) , > 0 , 0 , JSPROP_READONLY ); > JS_DefineProperty( cx , o , "mdnm" , > STRING_TO_JSVAL( > JS_NewString( cx , mdnm , strlen( mdnm ) ) ) , > 0 , 0 , JSPROP_READONLY ); > JS_DefineProperty( cx , o , "srnm" , > STRING_TO_JSVAL( > JS_NewString( cx , srnm , strlen( srnm ) ) ) , > 0 , 0 , JSPROP_READONLY ); > > 4) Printing the value of the property here give the correct > value. > > 5) returning the new object > *rval = OBJECT_TO_JSVAL( o ); > return JS_TRUE; It's clear you have not read http://www.mozilla.org/js/spidermonkey/gctips.html. /be .