@@ -3,17 +3,15 @@ function _classCallCheck(instance, Constructor) {
33 throw new TypeError ( "Cannot call a class as a function" ) ;
44 }
55}
6-
76function _defineProperties ( target , props ) {
87 for ( var i = 0 ; i < props . length ; i ++ ) {
98 var descriptor = props [ i ] ;
109 descriptor . enumerable = descriptor . enumerable || false ;
1110 descriptor . configurable = true ;
1211 if ( "value" in descriptor ) descriptor . writable = true ;
13- Object . defineProperty ( target , descriptor . key , descriptor ) ;
12+ Object . defineProperty ( target , _toPropertyKey ( descriptor . key ) , descriptor ) ;
1413 }
1514}
16-
1715function _createClass ( Constructor , protoProps , staticProps ) {
1816 if ( protoProps ) _defineProperties ( Constructor . prototype , protoProps ) ;
1917 if ( staticProps ) _defineProperties ( Constructor , staticProps ) ;
@@ -22,6 +20,20 @@ function _createClass(Constructor, protoProps, staticProps) {
2220 } ) ;
2321 return Constructor ;
2422}
23+ function _toPrimitive ( input , hint ) {
24+ if ( typeof input !== "object" || input === null ) return input ;
25+ var prim = input [ Symbol . toPrimitive ] ;
26+ if ( prim !== undefined ) {
27+ var res = prim . call ( input , hint || "default" ) ;
28+ if ( typeof res !== "object" ) return res ;
29+ throw new TypeError ( "@@toPrimitive must return a primitive value." ) ;
30+ }
31+ return ( hint === "string" ? String : Number ) ( input ) ;
32+ }
33+ function _toPropertyKey ( arg ) {
34+ var key = _toPrimitive ( arg , "string" ) ;
35+ return typeof key === "symbol" ? key : String ( key ) ;
36+ }
2537
2638var MyComponent = /*#__PURE__*/ _createClass ( function MyComponent ( ) {
2739 _classCallCheck ( this , MyComponent ) ;
0 commit comments