/**
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */

/**
 * Similar to invariant but only logs a warning if the condition is not met.
 * This can be used to log issues in development environments in critical
 * paths. Removing the logging code for production environments will keep the
 * same logic and follow the same code paths.
 */

let warningWithoutStack = () => {};

if (__DEV__) {
  warningWithoutStack = function(condition, format, ...args) {
    if (format === undefined) {
      throw new Error(
        '`warningWithoutStack(condition, format, ...args)` requires a warning ' +
          'message argument',
      );
    }
    if (args.length > 8) {
      // Check before the condition to catch violations early.
      throw new Error(
        'warningWithoutStack() currently supports at most 8 arguments.',
      );
    }
    if (condition) {
      return;
    }
    if (typeof console !== 'undefined') {
      const [a, b, c, d, e, f, g, h] = args.map(item => '' + item);
      const message = 'Warning: ' + format;

      // We intentionally don't use spread (or .apply) because it breaks IE9:
      // https://github.com/facebook/react/issues/13610
      switch (args.length) {
        case 0:
          console.error(message);
          break;
        case 1:
          console.error(message, a);
          break;
        case 2:
          console.error(message, a, b);
          break;
        case 3:
          console.error(message, a, b, c);
          break;
        case 4:
          console.error(message, a, b, c, d);
          break;
        case 5:
          console.error(message, a, b, c, d, e);
          break;
        case 6:
          console.error(message, a, b, c, d, e, f);
          break;
        case 7:
          console.error(message, a, b, c, d, e, f, g);
          break;
        case 8:
          console.error(message, a, b, c, d, e, f, g, h);
          break;
        default:
          throw new Error(
            'warningWithoutStack() currently supports at most 8 arguments.',
          );
      }
    }
    try {
      // --- Welcome to debugging React ---
      // This error was thrown as a convenience so that you can use this stack
      // to find the callsite that caused this warning to fire.
      let argIndex = 0;
      const message =
        'Warning: ' + format.replace(/%s/g, () => args[argIndex++]);
      throw new Error(message);
    } catch (x) {}
  };
}

export default warningWithoutStack;

@@ -1064,32 +1064,22 @@
 nst 
-%5Ba, b, c, d, e, f, g, h%5D
+argsWithFormat
  = a
@@ -1116,24 +1116,31 @@
     
-const message = 
+argsWithFormat.unshift(
 'War
@@ -1155,16 +1155,17 @@
 + format
+)
 ;%0A%0A     
@@ -1213,16 +1213,25 @@
  .apply)
+ directly
  because
@@ -1233,16 +1233,25 @@
 cause it
+%0A      //
  breaks 
@@ -1254,25 +1254,16 @@
 aks IE9:
-%0A      //
  https:/
@@ -1312,883 +1312,78 @@
     
-switch (args.length) %7B%0A        case 0:%0A          console.error(message);%0A          break;%0A        case 1:%0A          console.error(message, a);%0A          break;%0A        case 2:%0A          console.error(message, a, b);%0A          break;%0A        case 3:%0A          console.error(message, a, b, c);%0A          break;%0A        case 4:%0A          console.error(message, a, b, c, d);%0A          break;%0A        case 5:%0A          console.error(message, a, b, c, d, e);%0A          break;%0A        case 6:%0A          console.error(message, a, b, c, d, e, f);%0A          break;%0A        case 7:%0A          console.error(message, a, b, c, d, e, f, g);%0A          break;%0A        case 8:%0A          console.error(message, a, b, c, d, e, f, g, h);%0A          break;%0A        default:%0A          throw new Error(%0A            'warningWithoutStack() currently supports at most 8 arguments.',%0A          );%0A      %7D
+Function.prototype.apply.call(console.error, console, argsWithFormat);
 %0A   

Use Function.prototype.apply in warningWithoutStack (#14107)