assignment.js 901 B

12345678910111213141516171819202122232425262728293031
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. var tslib_1 = require("tslib");
  4. var node_1 = tslib_1.__importDefault(require("./node"));
  5. var Assignment = function (key, val) {
  6. this.key = key;
  7. this.value = val;
  8. };
  9. Assignment.prototype = Object.assign(new node_1.default(), {
  10. type: 'Assignment',
  11. accept: function (visitor) {
  12. this.value = visitor.visit(this.value);
  13. },
  14. eval: function (context) {
  15. if (this.value.eval) {
  16. return new Assignment(this.key, this.value.eval(context));
  17. }
  18. return this;
  19. },
  20. genCSS: function (context, output) {
  21. output.add(this.key + "=");
  22. if (this.value.genCSS) {
  23. this.value.genCSS(context, output);
  24. }
  25. else {
  26. output.add(this.value);
  27. }
  28. }
  29. });
  30. exports.default = Assignment;
  31. //# sourceMappingURL=assignment.js.map