mixin.js 521 B

1234567891011121314151617181920212223242526
  1. 'use strict';
  2. var Attrs = require('./attrs');
  3. /**
  4. * Initialize a new `Mixin` with `name` and `block`.
  5. *
  6. * @param {String} name
  7. * @param {String} args
  8. * @param {Block} block
  9. * @api public
  10. */
  11. var Mixin = module.exports = function Mixin(name, args, block, call){
  12. Attrs.call(this);
  13. this.name = name;
  14. this.args = args;
  15. this.block = block;
  16. this.call = call;
  17. };
  18. // Inherit from `Attrs`.
  19. Mixin.prototype = Object.create(Attrs.prototype);
  20. Mixin.prototype.constructor = Mixin;
  21. Mixin.prototype.type = 'Mixin';