Subj : Re: How to convert some C-values to jsval? To : netscape.public.mozilla.jseng From : =?ISO-8859-1?Q?Georg_Maa=DF?= Date : Wed Aug 06 2003 01:31 pm Brendan Eich wrote: > Georg Maaß wrote: > When you need a new object of a class (or of the Object class, in which > case you can pass null for the clasp parameter), call JS_NewObject. If > the class has a constructor and you want that run on the new object, > call JS_ConstructObject. If the constructor requires arguments, call > JS_ConstructObjectWithArguments. If you want to call JS_NewObject and > (if it succeeds) then JS_DefineProperty the new object so it has a name > in another object, call JS_DefineObject. > > The use of New, Construct, and Define is consistent in the API. New > means make a new unconstructed instance, Construct = New + call the > class constructor, Define means bind a property name to a value (in the > case of DefineObject, a New object). Thanks, this removes a lot of that fog and makes things look more clear. .