Revision: 4165 Author: [email protected] Date: Fri Jul 2 13:47:50 2010 Log: Make jsunit.js work without Cajita. http://codereview.appspot.com/1697047
jsunitCallback does a ___.markFuncFreeze and this is the only reference to Cajita in jsunit.js. This change makes it conditional on ___ existing.
[email protected] http://code.google.com/p/google-caja/source/detail?r=4165 Modified: /trunk/tests/com/google/caja/plugin/jsunit.js ======================================= --- /trunk/tests/com/google/caja/plugin/jsunit.js Wed Dec 9 15:23:04 2009 +++ /trunk/tests/com/google/caja/plugin/jsunit.js Fri Jul 2 13:47:50 2010 @@ -209,7 +209,7 @@ } var id = opt_id || jsunit.getCurrentTestId(); var callbackName = aFunction.name || '<anonymous>'; - return ___.markFuncFreeze(function(opt_args) { + function callback(opt_args) { var result = undefined; startLogMessagesGroup(id, callbackName); try { @@ -220,5 +220,8 @@ endLogMessagesGroup(id, callbackName); } return result; - }); -} + } + return typeof ___ !== 'undefined' + ? ___.markFuncFreeze(callback) + : callback; +}
