Subj : Re: Spidermonkey - Primitive objects To : Jan Herling From : Brendan Eich Date : Wed Dec 17 2003 10:54 am Jan Herling wrote: > Hallo, > > > I have a question to primitive objects in spidermonkey: > > I would like to define a named primitve object in spidermonkey like > "integer" or "double", > but I can not find any function to do this. What do you mean by "primtive object"? If you mean a primtive *type* such as the existing boolean, number, and string types (also undefined and null), then you can't extend the JS language using the language itself. If you wish to use the JS API to add new types, you're out of luck too -- the API does not support adding types or otherwise extending the language's semantics, except in the standard ECMA ways of adding new objects and properties. > I know "JS_DefineObject" but I think this can only define objects with > propertys and function. It's for creating a new object and giving it a name as a property of another object. It has nothing to do with "propertys and function(s)". If you really want to extend the JS type system, you should say a few words about why, I think. /be .