web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.8 KiB

  1. "use strict";
  2. exports.__esModule = true;
  3. exports.default = void 0;
  4. var _container = _interopRequireDefault(require("./container"));
  5. var _types = require("./types");
  6. function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  7. function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
  8. function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
  9. function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }
  10. var Root =
  11. /*#__PURE__*/
  12. function (_Container) {
  13. _inheritsLoose(Root, _Container);
  14. function Root(opts) {
  15. var _this;
  16. _this = _Container.call(this, opts) || this;
  17. _this.type = _types.ROOT;
  18. return _this;
  19. }
  20. var _proto = Root.prototype;
  21. _proto.toString = function toString() {
  22. var str = this.reduce(function (memo, selector) {
  23. memo.push(String(selector));
  24. return memo;
  25. }, []).join(',');
  26. return this.trailingComma ? str + ',' : str;
  27. };
  28. _proto.error = function error(message, options) {
  29. if (this._error) {
  30. return this._error(message, options);
  31. } else {
  32. return new Error(message);
  33. }
  34. };
  35. _createClass(Root, [{
  36. key: "errorGenerator",
  37. set: function set(handler) {
  38. this._error = handler;
  39. }
  40. }]);
  41. return Root;
  42. }(_container.default);
  43. exports.default = Root;
  44. module.exports = exports.default;