new JS Objects

Paul Chitescu Paul.Chitescu at IMC-Group.org
Wed Jul 16 15:11:18 CEST 2003


> Hello,
> I've programmed and add-ons module that extends the standard JS objects
> (like Window, History,...) with 3 new objects (A, B and C). I use the
> following line:
>   ...
>   hostobj.put("A",KJSO(s_objectA));
>   ...
>   hostobj.put("B",KJSO(s_objectB));
>   ...
>   hostobj.put("C",KJSO(s_objectC));
>   ...
> Then, when Konqueror starts the objects A, B and C are loaded.
> But one thing doesn't work: Konqueror doesn't work when analizes the
> following JS code:
>   ...
>   var variable;
>   ...
>   variable = new A;
>   ...
> How can I modify the add-ons module to create objects of A, B or C with
> JS code?
> Thanks in advance.

s_objectX must be pointers to instances of ConstructorImp derived classes.
The construct() virtual method will be called for each "new" statement.

If you want to store Part related information in the created objects then
you should not use static objects but instantiate a new constructor in the
callback extension function.

--
 Paul Chitescu
 pchitescu at null.ro   http://pchitescu.null.ro/   ICQ:22641673
 Any spammers will be painfully squeezed into /dev/null




More information about the konq-e mailing list