1212/* eslint-disable quotes, curly, no-proto, no-undef-init, dot-notation */
1313
1414// Created by running:
15- // require('babel-core').buildExternalHelpers('_extends classCallCheck createClass createRawReactElement defineProperty get inherits interopRequireDefault interopRequireWildcard objectWithoutProperties possibleConstructorReturn slicedToArray taggedTemplateLiteral toArray toConsumableArray '.split(' '))
16- // then replacing the `global` reference in the last line to also use `this`.
15+ // require('fs').writeFileSync('babelExternalHelpers.js', require('@babel/core').buildExternalHelpers('_extends classCallCheck createClass createRawReactElement defineProperty get inherits interopRequireDefault interopRequireWildcard objectWithoutProperties possibleConstructorReturn slicedToArray taggedTemplateLiteral toArray toConsumableArray wrapNativeSuper assertThisInitialized taggedTemplateLiteralLoose'.split(' ')))// then replacing the `global` reference in the last line to also use `this`.
1716//
18- // actually, that's a lie, because babel6 omits _extends and createRawReactElement
17+ // Actually, that's a lie, because babel omits _extends and
18+ // createRawReactElement. the file is also cleaned up a bit.
19+ // You may need to clear wrapNativeSuper while the bug hasn't been fixed yet.
20+ // Do try to keep diffs to a minimum.
1921
2022var babelHelpers = global . babelHelpers = { } ;
2123
22- babelHelpers . typeof = typeof Symbol === "function" && typeof Symbol . iterator === "symbol" ? function ( obj ) {
23- return typeof obj ;
24- } : function ( obj ) {
25- return obj && typeof Symbol === "function" && obj . constructor === Symbol && obj !== Symbol . prototype ? "symbol" : typeof obj ;
26- } ;
27-
2824babelHelpers . createRawReactElement = ( function ( ) {
2925 var REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol . for && Symbol . for ( "react.element" ) || 0xeac7 ;
3026 return function createRawReactElement ( type , key , props ) {
@@ -45,32 +41,20 @@ babelHelpers.classCallCheck = function (instance, Constructor) {
4541 }
4642} ;
4743
48- babelHelpers . createClass = ( function ( ) {
49- function defineProperties ( target , props ) {
50- for ( var i = 0 ; i < props . length ; i ++ ) {
51- var descriptor = props [ i ] ;
52- descriptor . enumerable = descriptor . enumerable || false ;
53- descriptor . configurable = true ;
54- if ( "value" in descriptor ) descriptor . writable = true ;
55- Object . defineProperty ( target , descriptor . key , descriptor ) ;
56- }
44+ function _defineProperties ( target , props ) {
45+ for ( var i = 0 ; i < props . length ; i ++ ) {
46+ var descriptor = props [ i ] ;
47+ descriptor . enumerable = descriptor . enumerable || false ;
48+ descriptor . configurable = true ;
49+ if ( "value" in descriptor ) descriptor . writable = true ;
50+ Object . defineProperty ( target , descriptor . key , descriptor ) ;
5751 }
52+ }
5853
59- return function ( Constructor , protoProps , staticProps ) {
60- if ( protoProps ) defineProperties ( Constructor . prototype , protoProps ) ;
61- if ( staticProps ) defineProperties ( Constructor , staticProps ) ;
62- return Constructor ;
63- } ;
64- } ) ( ) ;
65-
66- babelHelpers . defineEnumerableProperties = function ( obj , descs ) {
67- for ( var key in descs ) {
68- var desc = descs [ key ] ;
69- desc . configurable = ( desc . enumerable = true ) ;
70- if ( 'value' in desc ) desc . writable = true ;
71- Object . defineProperty ( obj , key , desc ) ;
72- }
73- return obj ;
54+ babelHelpers . createClass = function ( Constructor , protoProps , staticProps ) {
55+ if ( protoProps ) _defineProperties ( Constructor . prototype , protoProps ) ;
56+ if ( staticProps ) _defineProperties ( Constructor , staticProps ) ;
57+ return Constructor ;
7458} ;
7559
7660babelHelpers . defineProperty = function ( obj , key , value ) {
@@ -129,9 +113,8 @@ babelHelpers.get = function get(object, property, receiver) {
129113
130114babelHelpers . inherits = function ( subClass , superClass ) {
131115 if ( typeof superClass !== "function" && superClass !== null ) {
132- throw new TypeError ( "Super expression must either be null or a function, not " + typeof superClass ) ;
116+ throw new TypeError ( "Super expression must either be null or a function" ) ;
133117 }
134-
135118 subClass . prototype = Object . create ( superClass && superClass . prototype , {
136119 constructor : {
137120 value : subClass ,
@@ -143,6 +126,54 @@ babelHelpers.inherits = function (subClass, superClass) {
143126 if ( superClass ) Object . setPrototypeOf ? Object . setPrototypeOf ( subClass , superClass ) : subClass . __proto__ = superClass ;
144127} ;
145128
129+ var _gPO = Object . getPrototypeOf || function _gPO ( o ) { return o . __proto__ } ;
130+ var _sPO = Object . setPrototypeOf || function _sPO ( o , p ) { o . __proto__ = p ; return o } ;
131+ var _construct =
132+ // TODO: prepack does not like this line (and we can use the fallback just fine)
133+ // (typeof Reflect === "object" && Reflect.construct) ||
134+ function _construct ( Parent , args , Class ) {
135+ var Constructor , a = [ null ] ;
136+ a . push . apply ( a , args ) ;
137+ Constructor = Parent . bind . apply ( Parent , a ) ;
138+ return _sPO ( new Constructor , Class . prototype ) ;
139+ } ;
140+ var _cache = typeof Map === "function" && new Map ( ) ;
141+ babelHelpers . wrapNativeSuper = function ( Class ) {
142+ // FB:
143+ // Note: while extending native classes is pretty meh we do have cases, for
144+ // example; Error. There is also a false positive, for example; Blob.
145+
146+ if ( typeof Class !== "function" ) {
147+ throw new TypeError ( "Super expression must either be null or a function" ) ;
148+ }
149+ if ( typeof _cache !== "undefined" ) {
150+ if ( _cache . has ( Class ) ) return _cache . get ( Class ) ;
151+ _cache . set ( Class , Wrapper ) ;
152+ }
153+ function Wrapper ( ) {
154+ // this is a temporary fix for a babel bug (it's invoking the wrong func
155+ // when you do `super()`)
156+ return _construct ( Class , arguments , _gPO ( this ) . constructor ) ;
157+ }
158+ Wrapper . prototype = Object . create ( Class . prototype , {
159+ constructor : {
160+ value : Wrapper ,
161+ enumerable : false ,
162+ writeable : true ,
163+ configurable : true ,
164+ }
165+ } ) ;
166+ return _sPO (
167+ Wrapper ,
168+ _sPO (
169+ function Super ( ) {
170+ return _construct ( Class , arguments , _gPO ( this ) . constructor ) ;
171+ } ,
172+ Class
173+ )
174+ ) ;
175+ } ;
176+
146177babelHelpers . interopRequireDefault = function ( obj ) {
147178 return obj && obj . __esModule ? obj : {
148179 default : obj
@@ -157,7 +188,15 @@ babelHelpers.interopRequireWildcard = function (obj) {
157188
158189 if ( obj != null ) {
159190 for ( var key in obj ) {
160- if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) newObj [ key ] = obj [ key ] ;
191+ if ( Object . prototype . hasOwnProperty . call ( obj , key ) ) {
192+ var desc = Object . defineProperty && Object . getOwnPropertyDescriptor ? Object . getOwnPropertyDescriptor ( obj , key ) : { } ;
193+
194+ if ( desc . get || desc . set ) {
195+ Object . defineProperty ( newObj , key , desc ) ;
196+ } else {
197+ newObj [ key ] = obj [ key ] ;
198+ }
199+ }
161200 }
162201 }
163202
@@ -166,63 +205,79 @@ babelHelpers.interopRequireWildcard = function (obj) {
166205 }
167206} ;
168207
169- babelHelpers . objectWithoutProperties = function ( obj , keys ) {
208+ babelHelpers . objectWithoutProperties = function ( source , excluded ) {
209+ if ( source == null ) return { } ;
170210 var target = { } ;
211+ var sourceKeys = Object . keys ( source ) ;
212+ var key , i ;
213+
214+ for ( i = 0 ; i < sourceKeys . length ; i ++ ) {
215+ key = sourceKeys [ i ] ;
216+ if ( excluded . indexOf ( key ) >= 0 ) continue ;
217+ target [ key ] = source [ key ] ;
218+ }
219+
220+ if ( Object . getOwnPropertySymbols ) {
221+ var sourceSymbolKeys = Object . getOwnPropertySymbols ( source ) ;
171222
172- for ( var i in obj ) {
173- if ( keys . indexOf ( i ) >= 0 ) continue ;
174- if ( ! Object . prototype . hasOwnProperty . call ( obj , i ) ) continue ;
175- target [ i ] = obj [ i ] ;
223+ for ( i = 0 ; i < sourceSymbolKeys . length ; i ++ ) {
224+ key = sourceSymbolKeys [ i ] ;
225+ if ( excluded . indexOf ( key ) >= 0 ) continue ;
226+ if ( ! Object . prototype . propertyIsEnumerable . call ( source , key ) ) continue ;
227+ target [ key ] = source [ key ] ;
228+ }
176229 }
177230
178231 return target ;
179232} ;
180233
181234babelHelpers . possibleConstructorReturn = function ( self , call ) {
182- if ( ! self ) {
235+ if ( call && ( typeof call === "object" || typeof call === "function" ) ) {
236+ return call ;
237+ }
238+
239+ if ( self === void 0 ) {
183240 throw new ReferenceError ( "this hasn't been initialised - super() hasn't been called" ) ;
184241 }
185242
186- return call && ( typeof call === "object" || typeof call === "function" ) ? call : self ;
243+ return self ;
187244} ;
188245
189- babelHelpers . slicedToArray = ( function ( ) {
190- function sliceIterator ( arr , i ) {
191- var _arr = [ ] ;
192- var _n = true ;
193- var _d = false ;
194- var _e = undefined ;
246+ function _sliceIterator ( arr , i ) {
247+ var _arr = [ ] ;
248+ var _n = true ;
249+ var _d = false ;
250+ var _e = undefined ;
195251
196- try {
197- for ( var _i = arr [ Symbol . iterator ] ( ) , _s ; ! ( _n = ( _s = _i . next ( ) ) . done ) ; _n = true ) {
198- _arr . push ( _s . value ) ;
252+ try {
253+ for ( var _i = arr [ Symbol . iterator ] ( ) , _s ; ! ( _n = ( _s = _i . next ( ) ) . done ) ; _n = true ) {
254+ _arr . push ( _s . value ) ;
199255
200- if ( i && _arr . length === i ) break ;
201- }
202- } catch ( err ) {
203- _d = true ;
204- _e = err ;
256+ if ( i && _arr . length === i ) break ;
257+ }
258+ } catch ( err ) {
259+ _d = true ;
260+ _e = err ;
261+ } finally {
262+ try {
263+ if ( ! _n && _i [ "return" ] != null ) _i [ "return" ] ( ) ;
205264 } finally {
206- try {
207- if ( ! _n && _i [ "return" ] ) _i [ "return" ] ( ) ;
208- } finally {
209- if ( _d ) throw _e ;
210- }
265+ if ( _d ) throw _e ;
211266 }
212-
213- return _arr ;
214267 }
215268
216- return function ( arr , i ) {
217- if ( Array . isArray ( arr ) ) {
218- return arr ;
219- } else if ( Symbol . iterator in Object ( arr ) ) {
220- return sliceIterator ( arr , i ) ;
221- } else {
222- throw new TypeError ( "Invalid attempt to destructure non-iterable instance" ) ;
223- }
224- } ;
225- } ) ( ) ;
269+ return _arr ;
270+ }
271+
272+ babelHelpers . slicedToArray = function ( arr , i ) {
273+ if ( Array . isArray ( arr ) ) {
274+ return arr ;
275+ } else if ( Symbol . iterator in Object ( arr ) ) {
276+ return _sliceIterator ( arr , i ) ;
277+ } else {
278+ throw new TypeError ( "Invalid attempt to destructure non-iterable instance" ) ;
279+ }
280+ } ;
226281
227282babelHelpers . taggedTemplateLiteral = function ( strings , raw ) {
228283 return Object . freeze ( Object . defineProperties ( strings , {
@@ -238,10 +293,25 @@ babelHelpers.toArray = function (arr) {
238293
239294babelHelpers . toConsumableArray = function ( arr ) {
240295 if ( Array . isArray ( arr ) ) {
241- for ( var i = 0 , arr2 = Array ( arr . length ) ; i < arr . length ; i ++ ) arr2 [ i ] = arr [ i ] ;
296+ for ( var i = 0 , arr2 = new Array ( arr . length ) ; i < arr . length ; i ++ ) arr2 [ i ] = arr [ i ] ;
242297
243298 return arr2 ;
244299 } else {
245300 return Array . from ( arr ) ;
246301 }
247302} ;
303+
304+ babelHelpers . assertThisInitialized = function ( self ) {
305+ if ( self === void 0 ) {
306+ throw new ReferenceError (
307+ "this hasn't been initialised - super() hasn't been called" ,
308+ ) ;
309+ }
310+
311+ return self ;
312+ } ;
313+
314+ babelHelpers . taggedTemplateLiteralLoose = function ( strings , raw ) {
315+ strings . raw = raw ;
316+ return strings ;
317+ } ;
0 commit comments