react-test-renderer 16.6.0-alpha.8af6728 → 16.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /** @license React v16.6.0-alpha.8af6728
1
+ /** @license React v16.6.1
2
2
  * react-test-renderer-shallow.development.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -119,63 +119,24 @@ var warningWithoutStack = function () {};
119
119
  return;
120
120
  }
121
121
  if (typeof console !== 'undefined') {
122
- var _args$map = args.map(function (item) {
122
+ var argsWithFormat = args.map(function (item) {
123
123
  return '' + item;
124
- }),
125
- a = _args$map[0],
126
- b = _args$map[1],
127
- c = _args$map[2],
128
- d = _args$map[3],
129
- e = _args$map[4],
130
- f = _args$map[5],
131
- g = _args$map[6],
132
- h = _args$map[7];
133
-
134
- var message = 'Warning: ' + format;
135
-
136
- // We intentionally don't use spread (or .apply) because it breaks IE9:
137
- // https://github.com/facebook/react/issues/13610
138
- switch (args.length) {
139
- case 0:
140
- console.error(message);
141
- break;
142
- case 1:
143
- console.error(message, a);
144
- break;
145
- case 2:
146
- console.error(message, a, b);
147
- break;
148
- case 3:
149
- console.error(message, a, b, c);
150
- break;
151
- case 4:
152
- console.error(message, a, b, c, d);
153
- break;
154
- case 5:
155
- console.error(message, a, b, c, d, e);
156
- break;
157
- case 6:
158
- console.error(message, a, b, c, d, e, f);
159
- break;
160
- case 7:
161
- console.error(message, a, b, c, d, e, f, g);
162
- break;
163
- case 8:
164
- console.error(message, a, b, c, d, e, f, g, h);
165
- break;
166
- default:
167
- throw new Error('warningWithoutStack() currently supports at most 8 arguments.');
168
- }
124
+ });
125
+ argsWithFormat.unshift('Warning: ' + format);
126
+
127
+ // We intentionally don't use spread (or .apply) directly because it
128
+ // breaks IE9: https://github.com/facebook/react/issues/13610
129
+ Function.prototype.apply.call(console.error, console, argsWithFormat);
169
130
  }
170
131
  try {
171
132
  // --- Welcome to debugging React ---
172
133
  // This error was thrown as a convenience so that you can use this stack
173
134
  // to find the callsite that caused this warning to fire.
174
135
  var argIndex = 0;
175
- var _message = 'Warning: ' + format.replace(/%s/g, function () {
136
+ var message = 'Warning: ' + format.replace(/%s/g, function () {
176
137
  return args[argIndex++];
177
138
  });
178
- throw new Error(_message);
139
+ throw new Error(message);
179
140
  } catch (x) {}
180
141
  };
181
142
  }
@@ -193,17 +154,23 @@ var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeac
193
154
  var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
194
155
  var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
195
156
  var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace;
157
+
196
158
  var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
197
159
  var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
198
160
  var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
161
+ var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
162
+ var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
199
163
 
200
164
  var Resolved = 1;
201
165
 
202
166
 
167
+ function refineResolvedLazyComponent(lazyComponent) {
168
+ return lazyComponent._status === Resolved ? lazyComponent._result : null;
169
+ }
203
170
 
204
-
205
- function refineResolvedThenable(thenable) {
206
- return thenable._reactStatus === Resolved ? thenable._reactResult : null;
171
+ function getWrappedName(outerType, innerType, wrapperName) {
172
+ var functionName = innerType.displayName || innerType.name || '';
173
+ return outerType.displayName || (functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName);
207
174
  }
208
175
 
209
176
  function getComponentName(type) {
@@ -243,16 +210,17 @@ function getComponentName(type) {
243
210
  case REACT_PROVIDER_TYPE:
244
211
  return 'Context.Provider';
245
212
  case REACT_FORWARD_REF_TYPE:
246
- var renderFn = type.render;
247
- var functionName = renderFn.displayName || renderFn.name || '';
248
- return type.displayName || (functionName !== '' ? 'ForwardRef(' + functionName + ')' : 'ForwardRef');
249
- }
250
- if (typeof type.then === 'function') {
251
- var thenable = type;
252
- var resolvedThenable = refineResolvedThenable(thenable);
253
- if (resolvedThenable) {
254
- return getComponentName(resolvedThenable);
255
- }
213
+ return getWrappedName(type, type.render, 'ForwardRef');
214
+ case REACT_MEMO_TYPE:
215
+ return getComponentName(type.type);
216
+ case REACT_LAZY_TYPE:
217
+ {
218
+ var thenable = type;
219
+ var resolvedThenable = refineResolvedLazyComponent(thenable);
220
+ if (resolvedThenable) {
221
+ return getComponentName(resolvedThenable);
222
+ }
223
+ }
256
224
  }
257
225
  }
258
226
  return null;
@@ -1,4 +1,4 @@
1
- /** @license React v16.6.0-alpha.8af6728
1
+ /** @license React v16.6.1
2
2
  * react-test-renderer-shallow.production.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -9,18 +9,18 @@
9
9
 
10
10
  'use strict';var e=require("object-assign"),g=require("react"),n=require("react-is"),p=require("prop-types/checkPropTypes");function q(a,b,d,c,f,h,m,k){if(!a){a=void 0;if(void 0===b)a=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[d,c,f,h,m,k],D=0;a=Error(b.replace(/%s/g,function(){return l[D++]}));a.name="Invariant Violation"}a.framesToPop=1;throw a;}}
11
11
  function r(a){for(var b=arguments.length-1,d="https://reactjs.org/docs/error-decoder.html?invariant="+a,c=0;c<b;c++)d+="&args[]="+encodeURIComponent(arguments[c+1]);q(!1,"Minified React error #"+a+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",d)}
12
- var t=/^(.*)[\\\/]/,u="function"===typeof Symbol&&Symbol.for,v=u?Symbol.for("react.portal"):60106,w=u?Symbol.for("react.fragment"):60107,x=u?Symbol.for("react.strict_mode"):60108,y=u?Symbol.for("react.profiler"):60114,z=u?Symbol.for("react.provider"):60109,A=u?Symbol.for("react.context"):60110,B=u?Symbol.for("react.concurrent_mode"):60111,C=u?Symbol.for("react.forward_ref"):60112,E=u?Symbol.for("react.suspense"):60113;
13
- function F(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case B:return"ConcurrentMode";case w:return"Fragment";case v:return"Portal";case y:return"Profiler";case x:return"StrictMode";case E:return"Suspense"}if("object"===typeof a){switch(a.$$typeof){case A:return"Context.Consumer";case z:return"Context.Provider";case C:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+")":"ForwardRef")}if("function"===
14
- typeof a.then&&(a=1===a._reactStatus?a._reactResult:null))return F(a)}return null}var G=Object.prototype.hasOwnProperty;function H(a,b){return a===b?0!==a||0!==b||1/a===1/b:a!==a&&b!==b}function I(a,b){if(H(a,b))return!0;if("object"!==typeof a||null===a||"object"!==typeof b||null===b)return!1;var d=Object.keys(a),c=Object.keys(b);if(d.length!==c.length)return!1;for(c=0;c<d.length;c++)if(!G.call(b,d[c])||!H(a[d[c]],b[d[c]]))return!1;return!0}
15
- function J(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}
16
- var K={},L=function(){function a(b){J(this,a);this._renderer=b;this._callbacks=[]}a.prototype._enqueueCallback=function(b,a){"function"===typeof b&&a&&this._callbacks.push({callback:b,publicInstance:a})};a.prototype._invokeCallbacks=function(){var b=this._callbacks;this._callbacks=[];b.forEach(function(b){b.callback.call(b.publicInstance)})};a.prototype.isMounted=function(){return!!this._renderer._element};a.prototype.enqueueForceUpdate=function(b,a){this._enqueueCallback(a,b);this._renderer._forcedUpdate=
12
+ var t=/^(.*)[\\\/]/,u="function"===typeof Symbol&&Symbol.for,v=u?Symbol.for("react.portal"):60106,w=u?Symbol.for("react.fragment"):60107,x=u?Symbol.for("react.strict_mode"):60108,y=u?Symbol.for("react.profiler"):60114,z=u?Symbol.for("react.provider"):60109,A=u?Symbol.for("react.context"):60110,B=u?Symbol.for("react.concurrent_mode"):60111,C=u?Symbol.for("react.forward_ref"):60112,E=u?Symbol.for("react.suspense"):60113,F=u?Symbol.for("react.memo"):60115,G=u?Symbol.for("react.lazy"):60116;
13
+ function H(a){if(null==a)return null;if("function"===typeof a)return a.displayName||a.name||null;if("string"===typeof a)return a;switch(a){case B:return"ConcurrentMode";case w:return"Fragment";case v:return"Portal";case y:return"Profiler";case x:return"StrictMode";case E:return"Suspense"}if("object"===typeof a)switch(a.$$typeof){case A:return"Context.Consumer";case z:return"Context.Provider";case C:var b=a.render;b=b.displayName||b.name||"";return a.displayName||(""!==b?"ForwardRef("+b+")":"ForwardRef");
14
+ case F:return H(a.type);case G:if(a=1===a._status?a._result:null)return H(a)}return null}var I=Object.prototype.hasOwnProperty;function J(a,b){return a===b?0!==a||0!==b||1/a===1/b:a!==a&&b!==b}function K(a,b){if(J(a,b))return!0;if("object"!==typeof a||null===a||"object"!==typeof b||null===b)return!1;var d=Object.keys(a),c=Object.keys(b);if(d.length!==c.length)return!1;for(c=0;c<d.length;c++)if(!I.call(b,d[c])||!J(a[d[c]],b[d[c]]))return!1;return!0}
15
+ function L(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function");}
16
+ var M={},N=function(){function a(b){L(this,a);this._renderer=b;this._callbacks=[]}a.prototype._enqueueCallback=function(b,a){"function"===typeof b&&a&&this._callbacks.push({callback:b,publicInstance:a})};a.prototype._invokeCallbacks=function(){var b=this._callbacks;this._callbacks=[];b.forEach(function(b){b.callback.call(b.publicInstance)})};a.prototype.isMounted=function(){return!!this._renderer._element};a.prototype.enqueueForceUpdate=function(b,a){this._enqueueCallback(a,b);this._renderer._forcedUpdate=
17
17
  !0;this._renderer.render(this._renderer._element,this._renderer._context)};a.prototype.enqueueReplaceState=function(b,a,c){this._enqueueCallback(c,b);this._renderer._newState=a;this._renderer.render(this._renderer._element,this._renderer._context)};a.prototype.enqueueSetState=function(b,a,c){this._enqueueCallback(c,b);c=this._renderer._newState||b.state;"function"===typeof a&&(a=a.call(b,c,b.props));null!==a&&void 0!==a&&(this._renderer._newState=e({},c,a),this._renderer.render(this._renderer._element,
18
- this._renderer._context))};return a}(),O=function(){function a(){J(this,a);this._rendered=this._newState=this._instance=this._element=this._context=null;this._forcedUpdate=this._rendering=!1;this._updater=new L(this)}a.prototype.getMountedInstance=function(){return this._instance};a.prototype.getRenderOutput=function(){return this._rendered};a.prototype.render=function(b){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:K;g.isValidElement(b)?void 0:r("12","function"===typeof b?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":
19
- "");"string"===typeof b.type?r("13",b.type):void 0;n.isForwardRef(b)||"function"===typeof b.type?void 0:r("249",Array.isArray(b.type)?"array":null===b.type?"null":typeof b.type);if(!this._rendering){this._rendering=!0;this._element=b;var c=b.type.contextTypes;if(c){var f={},h;for(h in c)f[h]=a[h];a=f}else a=K;this._context=a;this._instance?this._updateClassComponent(b,this._context):n.isForwardRef(b)?this._rendered=b.type.render(b.props,b.ref):(a=b.type,a.prototype&&a.prototype.isReactComponent?(this._instance=
20
- new b.type(b.props,this._context,this._updater),this._updateStateFromStaticLifecycle(b.props),b.type.hasOwnProperty("contextTypes")&&(M=b,a=b.type,c=(c=this._instance)&&c.constructor,p(b.type.contextTypes,this._context,"context",a.displayName||c&&c.displayName||a.name||c&&c.name||null,N),M=null),this._mountClassComponent(b,this._context)):this._rendered=b.type.call(void 0,b.props,this._context));this._rendering=!1;this._updater._invokeCallbacks();return this.getRenderOutput()}};a.prototype.unmount=
18
+ this._renderer._context))};return a}(),Q=function(){function a(){L(this,a);this._rendered=this._newState=this._instance=this._element=this._context=null;this._forcedUpdate=this._rendering=!1;this._updater=new N(this)}a.prototype.getMountedInstance=function(){return this._instance};a.prototype.getRenderOutput=function(){return this._rendered};a.prototype.render=function(b){var a=1<arguments.length&&void 0!==arguments[1]?arguments[1]:M;g.isValidElement(b)?void 0:r("12","function"===typeof b?" Instead of passing a component class, make sure to instantiate it by passing it to React.createElement.":
19
+ "");"string"===typeof b.type?r("13",b.type):void 0;n.isForwardRef(b)||"function"===typeof b.type?void 0:r("249",Array.isArray(b.type)?"array":null===b.type?"null":typeof b.type);if(!this._rendering){this._rendering=!0;this._element=b;var c=b.type.contextTypes;if(c){var f={},h;for(h in c)f[h]=a[h];a=f}else a=M;this._context=a;this._instance?this._updateClassComponent(b,this._context):n.isForwardRef(b)?this._rendered=b.type.render(b.props,b.ref):(a=b.type,a.prototype&&a.prototype.isReactComponent?(this._instance=
20
+ new b.type(b.props,this._context,this._updater),this._updateStateFromStaticLifecycle(b.props),b.type.hasOwnProperty("contextTypes")&&(O=b,a=b.type,c=(c=this._instance)&&c.constructor,p(b.type.contextTypes,this._context,"context",a.displayName||c&&c.displayName||a.name||c&&c.name||null,P),O=null),this._mountClassComponent(b,this._context)):this._rendered=b.type.call(void 0,b.props,this._context));this._rendering=!1;this._updater._invokeCallbacks();return this.getRenderOutput()}};a.prototype.unmount=
21
21
  function(){this._instance&&"function"===typeof this._instance.componentWillUnmount&&this._instance.componentWillUnmount();this._instance=this._rendered=this._newState=this._element=this._context=null};a.prototype._mountClassComponent=function(a,d){this._instance.context=d;this._instance.props=a.props;this._instance.state=this._instance.state||null;this._instance.updater=this._updater;if("function"===typeof this._instance.UNSAFE_componentWillMount||"function"===typeof this._instance.componentWillMount)d=
22
- this._newState,"function"!==typeof a.type.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillMount&&this._instance.componentWillMount(),"function"===typeof this._instance.UNSAFE_componentWillMount&&this._instance.UNSAFE_componentWillMount()),d!==this._newState&&(this._instance.state=this._newState||K);this._rendered=this._instance.render()};a.prototype._updateClassComponent=function(a,d){var b=a.props,f=a.type,h=this._instance.state||
23
- K,m=this._instance.props;m!==b&&"function"!==typeof a.type.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillReceiveProps&&this._instance.componentWillReceiveProps(b,d),"function"===typeof this._instance.UNSAFE_componentWillReceiveProps&&this._instance.UNSAFE_componentWillReceiveProps(b,d));this._updateStateFromStaticLifecycle(b);var k=this._newState||h,l=!0;this._forcedUpdate?(l=!0,this._forcedUpdate=!1):"function"===
24
- typeof this._instance.shouldComponentUpdate?l=!!this._instance.shouldComponentUpdate(b,k,d):f.prototype&&f.prototype.isPureReactComponent&&(l=!I(m,b)||!I(h,k));l&&"function"!==typeof a.type.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillUpdate&&this._instance.componentWillUpdate(b,k,d),"function"===typeof this._instance.UNSAFE_componentWillUpdate&&this._instance.UNSAFE_componentWillUpdate(b,k,d));this._instance.context=
25
- d;this._instance.props=b;this._instance.state=k;l&&(this._rendered=this._instance.render())};a.prototype._updateStateFromStaticLifecycle=function(a){var b=this._element.type;if("function"===typeof b.getDerivedStateFromProps){var c=this._newState||this._instance.state;a=b.getDerivedStateFromProps.call(null,a,c);null!=a&&(c=e({},c,a),this._instance.state=this._newState=c)}};return a}();O.createRenderer=function(){return new O};var M=null;
26
- function N(){var a="";if(M){var b=null==M?"#empty":"string"===typeof M||"number"===typeof M?"#text":"string"===typeof M.type?M.type:M.type.displayName||M.type.name||"Unknown",d=M._owner,c=M._source;d=d&&F(d.type);var f="";c?f=" (at "+c.fileName.replace(t,"")+":"+c.lineNumber+")":d&&(f=" (created by "+d+")");a+="\n in "+(b||"Unknown")+f}return a}var P={default:O},Q=P&&O||P;module.exports=Q.default||Q;
22
+ this._newState,"function"!==typeof a.type.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillMount&&this._instance.componentWillMount(),"function"===typeof this._instance.UNSAFE_componentWillMount&&this._instance.UNSAFE_componentWillMount()),d!==this._newState&&(this._instance.state=this._newState||M);this._rendered=this._instance.render()};a.prototype._updateClassComponent=function(a,d){var b=a.props,f=a.type,h=this._instance.state||
23
+ M,m=this._instance.props;m!==b&&"function"!==typeof a.type.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillReceiveProps&&this._instance.componentWillReceiveProps(b,d),"function"===typeof this._instance.UNSAFE_componentWillReceiveProps&&this._instance.UNSAFE_componentWillReceiveProps(b,d));this._updateStateFromStaticLifecycle(b);var k=this._newState||h,l=!0;this._forcedUpdate?(l=!0,this._forcedUpdate=!1):"function"===
24
+ typeof this._instance.shouldComponentUpdate?l=!!this._instance.shouldComponentUpdate(b,k,d):f.prototype&&f.prototype.isPureReactComponent&&(l=!K(m,b)||!K(h,k));l&&"function"!==typeof a.type.getDerivedStateFromProps&&"function"!==typeof this._instance.getSnapshotBeforeUpdate&&("function"===typeof this._instance.componentWillUpdate&&this._instance.componentWillUpdate(b,k,d),"function"===typeof this._instance.UNSAFE_componentWillUpdate&&this._instance.UNSAFE_componentWillUpdate(b,k,d));this._instance.context=
25
+ d;this._instance.props=b;this._instance.state=k;l&&(this._rendered=this._instance.render())};a.prototype._updateStateFromStaticLifecycle=function(a){var b=this._element.type;if("function"===typeof b.getDerivedStateFromProps){var c=this._newState||this._instance.state;a=b.getDerivedStateFromProps.call(null,a,c);null!=a&&(c=e({},c,a),this._instance.state=this._newState=c)}};return a}();Q.createRenderer=function(){return new Q};var O=null;
26
+ function P(){var a="";if(O){var b=null==O?"#empty":"string"===typeof O||"number"===typeof O?"#text":"string"===typeof O.type?O.type:O.type.displayName||O.type.name||"Unknown",d=O._owner,c=O._source;d=d&&H(d.type);var f="";c?f=" (at "+c.fileName.replace(t,"")+":"+c.lineNumber+")":d&&(f=" (created by "+d+")");a+="\n in "+(b||"Unknown")+f}return a}var R={default:Q},S=R&&Q||R;module.exports=S.default||S;