sharing code between kjs and khtml

Dirk Mueller mueller at kde.org
Mon Jul 25 16:29:00 BST 2005


On Monday 25 July 2005 03:35, Maciej Stachowiak wrote:

> * Better assert macros. So far we've mostly avoided using our ASSERT
> macros in JavaScriptCore and in the WebCore khtml directory, however,
> they are better in a few ways than stock assert(). Most notably, they
> are set up to crash right in the stack frame where the assertion
> fails, instead of several frames worth of function calls down. This
> makes for much better stack traces and saves a lot of time when
> running under gdb.

This sounds a bit unportable, so I'm wondering how those look like. We have to 
support a lot of platforms, and this extra burden for something that can be 
solved with "up<enter><enter>" (4 keypresses) is something that imho should 
be evaluated. 

> 1) Cut and paste the relevant files, use in both places. This sucks
> because any fixes or improvements would have to be made in two
> places, and history shows that people will usually forget to update
> other copies of the code.

Copying of code is bad. 

> 3) Make a new module that both kjs and khtml depend on ("kxmlcore"?
> "kxmlbase"? something like that...).

I'd prefer that, though I don't know how to name the lib (and building such a 
convenience library inside khtml/ will be basically impossible thanks to 
autotools). 

> new logical module we would dump it in JavaScriptCore along with kjs
> and pcre to avoid making additional shared libraries.

Ah, yes, I remember that you forked pcre, so it makes a bit more sense for 
you. I guess in the KDE tree we'd go for a convenience library, even though 
that duplicates the code. 


-- 
Dirk//\




More information about the kfm-devel mailing list