Guest User

Untitled

a guest
Jul 15th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. /** @class
  2.  
  3. Mixin to allow for safe console actions
  4.  
  5. @author Colin Campbell
  6. @version 0.1
  7. @since 0.1
  8. */
  9. SC.Console = SC.Object.extend({
  10. /* Console Mixin */
  11.  
  12. // ..........................................................
  13. // PROPERTIES
  14. //
  15.  
  16. /**
  17. Computed property that checks for the existence of a console
  18. within the web browser
  19.  
  20. @property {Boolean}
  21. */
  22. exists: function() {
  23. return typeof(this._console) !== 'undefined' && this._console != null;
  24. }.property().cacheable(),
  25.  
  26. // ..........................................................
  27. // INTERNAL SUPPORT
  28. //
  29.  
  30. /**
  31. @private
  32.  
  33. Enables ability to override the console object in order to test
  34.  
  35. @property {Object}
  36. */
  37. _console: console
  38.  
  39. });
Add Comment
Please, Sign In to add comment