1. /**
    
  2.  * Copyright (c) Meta Platforms, Inc. and affiliates.
    
  3.  *
    
  4.  * This source code is licensed under the MIT license found in the
    
  5.  * LICENSE file in the root directory of this source tree.
    
  6.  *
    
  7.  * @noflow
    
  8.  */
    
  9. 
    
  10. // Provided by www
    
  11. const ReactFbErrorUtils = require('ReactFbErrorUtils');
    
  12. 
    
  13. if (typeof ReactFbErrorUtils.invokeGuardedCallback !== 'function') {
    
  14.   throw new Error(
    
  15.     'Expected ReactFbErrorUtils.invokeGuardedCallback to be a function.',
    
  16.   );
    
  17. }
    
  18. 
    
  19. function invokeGuardedCallbackImpl<A, B, C, D, E, F, Context>(
    
  20.   name: string | null,
    
  21.   func: (a: A, b: B, c: C, d: D, e: E, f: F) => mixed,
    
  22.   context: Context,
    
  23.   a: A,
    
  24.   b: B,
    
  25.   c: C,
    
  26.   d: D,
    
  27.   e: E,
    
  28.   f: F,
    
  29. ) {
    
  30.   // This will call `this.onError(err)` if an error was caught.
    
  31.   ReactFbErrorUtils.invokeGuardedCallback.apply(this, arguments);
    
  32. }
    
  33. 
    
  34. export default invokeGuardedCallbackImpl;