Skip to content

Commit

Permalink
Move DebugEnvironment helper to open source
Browse files Browse the repository at this point in the history
Summary:
This is an internal only module that we use to detect whether we are in async debugging mode.

Changelog: [Internal]

Reviewed By: yungsters

Differential Revision: D20879780

fbshipit-source-id: 5915f4e1c54a3fda0cf607c77f463120264fdbc4
  • Loading branch information
TheSavior authored and alloy committed Apr 8, 2020
1 parent 6b6877d commit 6e530d9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Libraries/Utilities/DebugEnvironment.js
@@ -0,0 +1,21 @@
/**
* 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.
*
* @format
* @flow strict-local
*/

'use strict';

export let isAsyncDebugging: boolean = false;

if (__DEV__) {
// These native interfaces don't exist in asynchronous debugging environments.
isAsyncDebugging =
!global.nativeExtensions &&
!global.nativeCallSyncHook &&
!global.RN$Bridgeless;
}

0 comments on commit 6e530d9

Please sign in to comment.