53f250be1e6e03ad9da3013f6ebd69f6.json 6.24 KB
{"ast":null,"code":"import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/createSuper\";\nimport * as React from 'react';\nimport Alert from '.';\n\nvar ErrorBoundary = /*#__PURE__*/function (_React$Component) {\n  _inherits(ErrorBoundary, _React$Component);\n\n  var _super = _createSuper(ErrorBoundary);\n\n  function ErrorBoundary() {\n    var _this;\n\n    _classCallCheck(this, ErrorBoundary);\n\n    _this = _super.apply(this, arguments);\n    _this.state = {\n      error: undefined,\n      info: {\n        componentStack: ''\n      }\n    };\n    return _this;\n  }\n\n  _createClass(ErrorBoundary, [{\n    key: \"componentDidCatch\",\n    value: function componentDidCatch(error, info) {\n      this.setState({\n        error: error,\n        info: info\n      });\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      var _this$props = this.props,\n          message = _this$props.message,\n          description = _this$props.description,\n          children = _this$props.children;\n      var _this$state = this.state,\n          error = _this$state.error,\n          info = _this$state.info;\n      var componentStack = info && info.componentStack ? info.componentStack : null;\n      var errorMessage = typeof message === 'undefined' ? (error || '').toString() : message;\n      var errorDescription = typeof description === 'undefined' ? componentStack : description;\n\n      if (error) {\n        return /*#__PURE__*/React.createElement(Alert, {\n          type: \"error\",\n          message: errorMessage,\n          description: /*#__PURE__*/React.createElement(\"pre\", null, errorDescription)\n        });\n      }\n\n      return children;\n    }\n  }]);\n\n  return ErrorBoundary;\n}(React.Component);\n\nexport { ErrorBoundary as default };","map":{"version":3,"sources":["C:/Users/kkwan_000/Desktop/git/2017110269/minsung/node_modules/antd/es/alert/ErrorBoundary.js"],"names":["_classCallCheck","_createClass","_inherits","_createSuper","React","Alert","ErrorBoundary","_React$Component","_super","_this","apply","arguments","state","error","undefined","info","componentStack","key","value","componentDidCatch","setState","render","_this$props","props","message","description","children","_this$state","errorMessage","toString","errorD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AAA,UAGIC,QAAQ,GAAGJ,WAAW,CAACI,QAH3B;AAIA,UAAIC,WAAW,GAAG,KAAKf,KAAvB;AAAA,UACIC,KAAK,GAAGc,WAAW,CAACd,KADxB;AAAA,UAEIE,IAAI,GAAGY,WAAW,CAACZ,IAFvB;AAGA,UAAIC,cAAc,GAAGD,IAAI,IAAIA,IAAI,CAACC,cAAb,GAA8BD,IAAI,CAACC,cAAnC,GAAoD,IAAzE;AACA,UAAIY,YAAY,GAAG,OAAOJ,OAAP,KAAmB,WAAnB,GAAiC,CAACX,KAAK,IAAI,EAAV,EAAcgB,QAAd,EAAjC,GAA4DL,OAA/E;AACA,UAAIM,gBAAgB,GAAG,OAAOL,WAAP,KAAuB,WAAvB,GAAqCT,cAArC,GAAsDS,WAA7E;;AAEA,UAAIZ,KAAJ,EAAW;AACT,eAAO,aAAaT,KAAK,CAAC2B,aAAN,CAAoB1B,KAApB,EAA2B;AAC7C2B,UAAAA,IAAI,EAAE,OADuC;AAE7CR,UAAAA,OAAO,EAAEI,YAFoC;AAG7CH,UAAAA,WAAW,EAAE,aAAarB,KAAK,CAAC2B,aAAN,CAAoB,KAApB,EAA2B,IAA3B,EAAiCD,gBAAjC;AAHmB,SAA3B,CAApB;AAKD;;AAED,aAAOJ,QAAP;AACD;AAvBA,GARyB,CAAhB,CAAZ;;AAkCA,SAAOpB,aAAP;AACD,CAvDgC,CAuD/BF,KAAK,CAAC6B,SAvDyB,CAAjC;;AAyDA,SAAS3B,aAAa,IAAI4B,OAA1B","sourcesContent":["import _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _createSuper from \"@babel/runtime/helpers/createSuper\";\nimport * as React from 'react';\nimport Alert from '.';\n\nvar ErrorBoundary = /*#__PURE__*/function (_React$Component) {\n  _inherits(ErrorBoundary, _React$Component);\n\n  var _super = _createSuper(ErrorBoundary);\n\n  function ErrorBoundary() {\n    var _this;\n\n    _classCallCheck(this, ErrorBoundary);\n\n    _this = _super.apply(this, arguments);\n    _this.state = {\n      error: undefined,\n      info: {\n        componentStack: ''\n      }\n    };\n    return _this;\n  }\n\n  _createClass(ErrorBoundary, [{\n    key: \"componentDidCatch\",\n    value: function componentDidCatch(error, info) {\n      this.setState({\n        error: error,\n        info: info\n      });\n    }\n  }, {\n    key: \"render\",\n    value: function render() {\n      var _this$props = this.props,\n          message = _this$props.message,\n          description = _this$props.description,\n          children = _this$props.children;\n      var _this$state = this.state,\n          error = _this$state.error,\n          info = _this$state.info;\n      var componentStack = info && info.componentStack ? info.componentStack : null;\n      var errorMessage = typeof message === 'undefined' ? (error || '').toString() : message;\n      var errorDescription = typeof description === 'undefined' ? componentStack : description;\n\n      if (error) {\n        return /*#__PURE__*/React.createElement(Alert, {\n          type: \"error\",\n          message: errorMessage,\n          description: /*#__PURE__*/React.createElement(\"pre\", null, errorDescription)\n        });\n      }\n\n      return children;\n    }\n  }]);\n\n  return ErrorBoundary;\n}(React.Component);\n\nexport { ErrorBoundary as default };"]},"metadata":{},"sourceType":"module"}