Joy 2.1 Release Notes
As this is the first release of OS X Server, we have not had access to the full customer release to test our software. Throughout the history of OS X Server (Rhapsody) there have been numerous changes; due to our software being quite low-level this has in the past caused some problems.
The problems you encounter should be minor though. Feel free to go to our web site www.aaa-plus.com/joy to see new patches and upgrades as they appear.
These are the changes from Joy 2.1b1 as released on the MacOS X Server 3rd party software CD to Joy 2.1:
- Added new ITKJSProperties informal protocol, to allow Objective-C classes to redefine the semantics of JavaScript properties for their instances. For example, in an application built on EOF, you could easily implement it for your business objects, so you can access EOF properties using the convenient syntax object.property instead of accessor methods. Joy already provides implementations of this protocol for the NSArray and NSDictionary classes. This also fixes a bug where using for..in on an NSMutableArray would sometimes try to enumerate invalid indices.
- Improved handling of EOFaults. Faults are now automatically fired before accessing their JavaScript properties, or enumerating an array fault with for..in.
- Fixed bug where class methods taught to NSObject could be 'forgotten' in some circumstances.
- Fixed some bugs regarding decompilation of JavaScript code.
- Fixed a bug in [ITKJSInterp eval:] where it could not access the local variables of the current stack frame as advertised.
- Made conversion of Objective-C objects to JavaScript strings more robust.
These are the changes from Joy 2.0 to Joy 2.1b1:
- Support for calling Java from both of Joy's scripting languages has been added. To actively enable Java (and create a virtual machine if necessary) use [self enableJavaSupport] in JavaScript, or either $self enableJavaSupport or package require java in Tcl. There is also a preference setting to automatically enable Java during initialization, or to have Joy attach automatically to the Java virtual machine once one has been created (this is the default setting). There is a small tutorial on using Java from JavaScript (section 4 of the JavaScript tutorial).
- Documented Objective-C API has been added. Feel free to contact joy@aaa-plus.com if you have any questions, or suggestions for additions to the API.
- Upgraded to JavaScript version 1.4 from 1.3. Most important new features are better exception handling and that JavaScript objects now support not only a toString() but also a toSource() method, to get a string that can be passed to eval to get the original object back. As a consequence of same upgrade, you are no longer able to use "shell-command" like function calls that were tolerated by Joy 2.0, e.g. help instead of help(), or print obj instead of print(obj). Though convenient, this feature was a hack and did not fit in with the rest of the language, so has been removed.
- Added support for Objective-C style exception handling (NS_DURING...NS_HANDLER) to JavaScript. The JavaScript try...catch statement now also supports a finally clause.
- Grouping declarations inside extern "C" { ... } in JavaScript makes the parser switch from JavaScript's keyword set to C's, making parsing of system header files easier.
- Fixed a problem where Joy could cause hangs in multithreaded programs. Joy is still not thread-safe, i.e. just one thread can safely use scripted methods, but should be at least thread-tolerant.
- Fixed JavaScript bug where the comparison operators would not work on pointers.
- Fixed JavaScript parser bug where array index expressions would not work if the array expression spanned more than one line.
- Fixed JavaScript bug where #define, #ifdef and the like would not work when used inside JavaScript functions.
- Fixed JavaScript bug where one C array could not be assigned from another, affecting structure assignments as well if they happened to contain an array.
- Made #import "file" look for file in the directory of the importing source file before searching through the standard paths.
- On Windows, renamed tcl80.dll to itktcl80.dll to avoid version clashes with other tcl-based software.
The following issues from Joy 2.0 are still valid:
- On OS X, using Joy Services, whenever program 'X' is loading, rather than saying "Loading X" on the right-hand side of the menu bar, it says "Loading Joy Services".
- Passing JavaScript functions as function pointers (JavaScript call back functions) is not yet supported.
- The const keyword is parsed, but ignored.
- Creating Objective-C root classes from JavaScript is possible, but not recommended. (All of the infrastructure normally inherited from NSObject is missing, which can cause Joy to crash.)
- The +initialize method is not called automatically. Workaround: Call it by hand, and make sure your own initialize methods are executed just once by using a flag, like Apple documentation recommends doing anyway.
- The "preprocessor" directives in JavaScript don't do line continuation (backslash-newline) correctly.
- Wide character literals (L"string") and the wchar_t data type are not supported.
- References to tagged structs and unions are resolved eagerly. This bloats precompiled header files and causes forward references to fail. (Joy will treat the forward reference like an empty struct.) Workaround: Often you can force Joy to use the correct struct definition by using an extra type cast.
Extra issues with YellowBox for Windows
- The __stdcall keyword is parsed, but ignored.
- The #pragma for special alignment of structs is ignored. This, together with the previous restriction, makes calling of Windows API from Joy difficult.