We have added a method named exit() into Jaggery master, which will allow
you to stop the script execution at any point.

Earlier, you had to wrap the scripts with an anonymous function for
achieving this. But, now you can simply use exit(); method at any point and
the script execution will be stopped immediately.

According to Rhino's documentation, only log 1 should get printed. But at
the moment, log 3 too, get printed. We will have to investigate on that
further. Anyway, you will be able to use it for most of the stuff even
without that.

<%
var log = new Log();
log.info('--------1------');
try {
exit();
} catch(e) {
log.info('-------2-------');
} finally {
log.info('-------3-------');
}
log.info('-------4--------');
%>

[1]
https://github.com/mozilla/rhino/blob/82ffb8f3e09e77e3b1f5782c35b621e7ca742b58/src/org/mozilla/javascript/ContextFactory.java



-- 

*Ruchira Wageesha**Associate Technical Lead*
*WSO2 Inc. - lean . enterprise . middleware |  wso2.com <http://wso2.com>*

*email: [email protected] <[email protected]>,   blog:
ruchirawageesha.blogspot.com <http://ruchirawageesha.blogspot.com>,
mobile: +94 77 5493444*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to