PATH  WebObjects 4.0 Documentation > What's New in WebObjects 4.0

Table of Contents Previous Section

WebScript Changes

In WebObjects 3.5, WebScript would always evaluate both sides of an "&&" or "||" expression. In WebObjects 4.0, these expressions are now short-circuited, so that only the left side is evaluated unless evaluation of the right side is necessary in order to determine the result. For example:

(YES || <this will NOT evaluate>)
(NO  || <this will evaluate>)
(YES && <this will evaluate>)
(NO  && <this will NOT evaluate>)
To aid in the debugging process, WebObjects 4.0 has a WebScript 3.5 compatibility mode. This mode is controlled by a method in WOApplication named requiresWOF35Scripting. By default, this method returns NO; override it to return YES to get backward compatibility.

Table of Contents Next Section