|
From: Pennell, D. <DPe...@qu...> - 2003-10-30 14:15:27
|
Current status: Parsing ======= - All syntax should be accepted except RegExp literals and Unicode source. - Error reporting is dismal - most errors end up as "Unexpected token", some as infinite loops in parser Core Engine ========================== - All expressions (except those involving RegExp literals) are implemented and have test cases. - Number to string conversion is imcomplete - I need to tackle the "Gay algorithm". The biggest issue is that doubles are going to print with "d" at the end. - Runtime error reporting could certainly be improved. The spec generally just says "throw XXXError", I've begun using Mozilla as a reference for adding a reasonable message to XXXError. - Runtime environment is now "thread-safe". All execution state is in the execution context. Objects ======= - Global All except parseInt(), parseFloat(), decodeURI(), decodeURIComponent(), encodeURI(), encodeURIComponent() - Function Enough exists to support builtin functions and user defined function, none of the Function.prototype functions except toString() are implemented yet. Additional property: setting trace to true (or anything that will convert to true) will generate SmeeFunctionEnter and SmeeFunctionExit exceptions. The exceptions carry the name of the function, the arguments and on exit, the return value. - Array Functionally complete, but it deserves some performance improvement. - String All functions complete except those that take RegExp objects as arguments: match(), replace(), search(), split(). Several functions need additional Unicode support: localeCompare(), toLowerCase(), toLocaleLowerCase(), toUpperCase(), toLocaleUpperCase() - Boolean Complete - Number All functions except those that convert to strings (that pesky Gay algorithm again): toFixed(),toExponential(), toPrecision() Additonal functions: toInt32(), toUint16() and toUint32(). - Math All functions except atan2() and pow() - Date Locale specific functions are identical to the non-locale versions. Specification allows implementation choice on string representation, both for Date->string and string->Date. Smee uses a simple yyyy.mm.dd-hh:mm:ss.mmm format. - RegExp The object exists and could be constructed, but none of the functions are implemented. Vassili Bykov provided a summary of the differences between his Regex11 and the ECMAScript spec. There are quite a few issues, many of which are resolved in his next version. I'm trying to decide if I should wait for his next version or just build my own from the ECMAScript spec. I may just provide a first cut that uses Vassili's code and then decide. - Error (and its children) Complete. Next Steps ========== - Finish string->number, Global and Math - SmeeHostObject will wrap any non-Smee object. You will have a choice of instantiating this in promiscuous mode or of explicitly specifying which bits of the protocol are exposed. In promiscuous mode accessor methods will appear as value properties and all other methods will appear as function properties. The host objects class will appear as the prototype. New properties will be added to the wrapper. I haven't enough time thinking about the controlled access instantiation protocol yet. It seems clear that you will want to provide a collection of methods that are accessible, but I'm not sure what else is needed. - Move prototype functions from class side to instance side It seemed like the right choice at the time, but now that I have a better understanding of prototype functions, "this" and function tranferrance, I realize that I can move these to the instance side and simplify things. - Implement RegExp. I'll probably do this in two phases - use Regex11 in the first phase, and either use its successor in the second phase or roll my own. The first phase would also involve completing the String prototype functions. - Improve error handling in parser - Improve error reporting in parser and runtime - Add Unicode support - Performance. Improve performance when and if necessary. I've run one test so far: Parse 'a+b*2'. Instantiate global context. In loop, set values for a and b in context, execute program and retrieve result. On my 1GHz notebook, it executes at 30 KHz. I need to run tests with function calls, I expect that they need some work. |