Friends, before Adam dives into javascript duktape engine, if he could procrastinate just a couple more days, I would like to ask a question. This is just for discussion, I don't know enough even to have an opinion.
The edbrowse-js that we have working today, based on mozilla, is 2354 lines of c++. Within this, the setters and getters for the URL class are 439 lines of code, almost one fifth of the total. If we include other setter code, such as document.cookie = "foo=bar" folding this into the entire document.cookie string, we could be talking about a quarter of the code or more. This is all C, and all tightly coupled to the getter syntaax of whatever engine we are using, all has to be modified whenever we upgrade or switch engines. My question is, could some of this be done by generic javascript in the sourcefile startwindow.js? Does it really have to be native C? There are already some URL.prototype definitions in there, perhaps we could add some getters and setters easily that would do all the stuff I do in C today. Have a look at this web page. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Working_with_Objects Read the section Defining getters and setters Is this mozilla specific, or generic javascript? Perhaps run some of the examples through d8. The examples seem to suggest object.x can be defined as a getter or setter but not both. If that is the case then it won't work for us. URL.port needs to fetch the port, 80 for example, but url.port = 8080 needs to set the port and also change the port in url.href. This is an area of javascript that I didn't know existed at all until last week, so I'm still learning. Just raising some questions, because the several hundred lines of C code that implement the setters are a bit ugly, or at least awkward and engine specific. Karl Dahlke _______________________________________________ Edbrowse-dev mailing list [email protected] http://lists.the-brannons.com/mailman/listinfo/edbrowse-dev
