1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- 'use strict';
- var emptyFunction = require('./emptyFunction');
- var warning = emptyFunction;
- if (__DEV__) {
- function printWarning(format, ...args) {
- var argIndex = 0;
- var message = 'Warning: ' + format.replace(/%s/g, () => args[argIndex++]);
- if (typeof console !== 'undefined') {
- console.error(message);
- }
- try {
-
-
-
- throw new Error(message);
- } catch (x) {}
- }
- warning = function (condition, format, ...args) {
- if (format === undefined) {
- throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');
- }
- if (format.indexOf('Failed Composite propType: ') === 0) {
- return;
- }
- if (!condition) {
- printWarning(format, ...args);
- }
- };
- }
- module.exports = warning;
|