mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-06 22:37:14 +08:00
Expose setGlobalVariable in CatalystInstance interface
Summary: this helps with cleaning up some tests public Reviewed By: astreet Differential Revision: D2816285 fb-gh-sync-id: 37c4da7bdb3c8b5439184316bb5a8939160b40a3
This commit is contained in:
committed by
facebook-github-bot-5
parent
48117ce6c4
commit
a9a7c78899
@@ -12,6 +12,7 @@ package com.facebook.react.bridge;
|
||||
import java.util.Collection;
|
||||
|
||||
import com.facebook.react.bridge.queue.CatalystQueueConfiguration;
|
||||
import com.facebook.react.common.annotations.VisibleForTesting;
|
||||
import com.facebook.proguard.annotations.DoNotStrip;
|
||||
import com.facebook.react.common.annotations.VisibleForTesting;
|
||||
|
||||
@@ -66,4 +67,7 @@ public interface CatalystInstance {
|
||||
boolean supportsProfiling();
|
||||
void startProfiler(String title);
|
||||
void stopProfiler(String title, String filename);
|
||||
|
||||
@VisibleForTesting
|
||||
void setGlobalVariable(String propName, String jsonValue);
|
||||
}
|
||||
|
||||
@@ -306,11 +306,6 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||
return mCatalystQueueConfiguration;
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
public ReactBridge getBridge() {
|
||||
return mBridge;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T extends JavaScriptModule> T getJSModule(Class<T> jsInterface) {
|
||||
return Assertions.assertNotNull(mJSModuleRegistry).getJavaScriptModule(jsInterface);
|
||||
@@ -366,6 +361,12 @@ public class CatalystInstanceImpl implements CatalystInstance {
|
||||
mBridge.stopProfiler(title, filename);
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
@Override
|
||||
public void setGlobalVariable(String propName, String jsonValue) {
|
||||
mBridge.setGlobalVariable(propName, jsonValue);
|
||||
}
|
||||
|
||||
private String buildModulesConfigJSONProperty(
|
||||
NativeModuleRegistry nativeModuleRegistry,
|
||||
JavaScriptModulesConfig jsModulesConfig) {
|
||||
|
||||
Reference in New Issue
Block a user