case.js 649 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*!
  2. * Jade - nodes - Case
  3. * Copyright(c) 2010 TJ Holowaychuk <tj@vision-media.ca>
  4. * MIT Licensed
  5. */
  6. /**
  7. * Module dependencies.
  8. */
  9. var Node = require('./node');
  10. /**
  11. * Initialize a new `Case` with `expr`.
  12. *
  13. * @param {String} expr
  14. * @api public
  15. */
  16. var Case = exports = module.exports = function Case(expr, block){
  17. this.expr = expr;
  18. this.block = block;
  19. };
  20. /**
  21. * Inherit from `Node`.
  22. */
  23. Case.prototype.__proto__ = Node.prototype;
  24. var When = exports.When = function When(expr, block){
  25. this.expr = expr;
  26. this.block = block;
  27. this.debug = false;
  28. };
  29. /**
  30. * Inherit from `Node`.
  31. */
  32. When.prototype.__proto__ = Node.prototype;