mirror of
https://github.com/facebook/react-native.git
synced 2026-11-18 20:19:07 +00:00
Add a getter for enabling console.createTask (#54283)
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54283 # Changelog: [Internal] This will control scenarios when we enable `console.createTask` implementation, and when we just use the stub version. Reviewed By: huntie Differential Revision: D85440641 fbshipit-source-id: 61b36a2452c2c656be2865defda25eb472c64d4c
This commit is contained in:
1 parent
f1f69462fd
commit
72834e6326
2 files changed
+16
No files matched your search
@@ -248,6 +248,18 @@ bool RuntimeTarget::isDomainEnabled(Domain domain) const {
|
||||
return threadSafeDomainStatus_[domain];
|
||||
}
|
||||
|
||||
bool RuntimeTarget::isConsoleCreateTaskEnabled() const {
|
||||
if (isDomainEnabled(Domain::Runtime)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (auto tracingAgent = tracingAgent_.lock()) {
|
||||
return tracingAgent->isRunningInBackgroundMode();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
RuntimeTargetController::RuntimeTargetController(RuntimeTarget& target)
|
||||
: target_(target) {}
|
||||
|
||||
|
||||
@@ -292,6 +292,10 @@ class JSINSPECTOR_EXPORT RuntimeTarget : public EnableExecutorFromThis<RuntimeTa
|
||||
* Install the console API handler.
|
||||
*/
|
||||
void installConsoleHandler();
|
||||
/**
|
||||
* Returns whether console.createTask should actually capture stack traces.
|
||||
*/
|
||||
bool isConsoleCreateTaskEnabled() const;
|
||||
|
||||
/**
|
||||
* Installs __DEBUGGER_SESSION_OBSERVER__ object on the JavaScript's global
|
||||
|
||||
Reference in new issue
Block a user