Reviewers: ihab.awad,

Description:
jsunitCallback does a ___.markFuncFreeze and this is the only reference
to Cajita in jsunit.js. This change makes it conditional on ___
existing.

Please review this at http://codereview.appspot.com/1697047/show

Affected files:
  M     tests/com/google/caja/plugin/jsunit.js


Index: tests/com/google/caja/plugin/jsunit.js
===================================================================
--- tests/com/google/caja/plugin/jsunit.js      (revision 4164)
+++ tests/com/google/caja/plugin/jsunit.js      (working copy)
@@ -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;
 }


Reply via email to