July 31, 2002

More work on Cocoon's control flow layer


I'm close to finishing the changes I've made in the control flow layer to improve the usability of the whole system.

Cristopher Oliver came up a while ago (in an email dated May 20) with an idea of how to share the JavaScript bytecodes among various users, yet keep the variables space separate:

I looked into this briefly and I think the following approach might work: precompile scripts using Context.compileReader() to Script objects instead of using Context.evaluateReader(). The compiled Script object is immutable and can be shared between threads. You can then evaluate the script on 'thrScope' via Script.exec(context, thrScope).

This requires that all the script files that need to be read have to be aggregated as one single large file. I'm using a SequenceInputStream to do this, which works fine except for the fact that file location is lost. This means that error reporting is pretty much useless.

What I want to do is create a specialized class which is able to keep track of source files and their line numbers. The JavaScript error reporting will then be able to use this object to report the correct location.

Posted by ovidiu at July 31, 2002 02:44 PM |
Copyright © 2002-2016 Ovidiu Predescu.