export_asserts.js 581 B

123456789101112131415161718192021222324252627
  1. /**
  2. * @fileoverview Description of this file.
  3. */
  4. goog.require('goog.testing.asserts');
  5. var global = Function('return this')();
  6. // The Google Closure assert functions start with assert, eg.
  7. // assertThrows
  8. // assertNotThrows
  9. // assertTrue
  10. // ...
  11. //
  12. // The one exception is the "fail" function.
  13. function shouldExport(str) {
  14. return str.lastIndexOf('assert') === 0 || str == 'fail';
  15. }
  16. for (var key in global) {
  17. if ((typeof key == "string") && global.hasOwnProperty(key) &&
  18. shouldExport(key)) {
  19. exports[key] = global[key];
  20. }
  21. }
  22. exports.COMPILED = COMPILED