Skip to content

Commit

Permalink
Expose setGlobalVariable in CatalystInstance interface
Browse files Browse the repository at this point in the history
Summary:
this helps with cleaning up some tests
public

Reviewed By: astreet

Differential Revision: D2816285

fb-gh-sync-id: 37c4da7bdb3c8b5439184316bb5a8939160b40a3
  • Loading branch information
mhorowitz authored and facebook-github-bot-5 committed Jan 21, 2016
1 parent 48117ce commit a9a7c78
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
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;

Expand Down Expand Up @@ -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);
}
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,6 @@ public CatalystQueueConfiguration getCatalystQueueConfiguration() {
return mCatalystQueueConfiguration;
}

@VisibleForTesting
public ReactBridge getBridge() {
return mBridge;
}

@Override
public <T extends JavaScriptModule> T getJSModule(Class<T> jsInterface) {
return Assertions.assertNotNull(mJSModuleRegistry).getJavaScriptModule(jsInterface);
Expand Down Expand Up @@ -366,6 +361,12 @@ public void stopProfiler(String title, String filename) {
mBridge.stopProfiler(title, filename);
}

@VisibleForTesting
@Override
public void setGlobalVariable(String propName, String jsonValue) {
mBridge.setGlobalVariable(propName, jsonValue);
}

private String buildModulesConfigJSONProperty(
NativeModuleRegistry nativeModuleRegistry,
JavaScriptModulesConfig jsModulesConfig) {
Expand Down

0 comments on commit a9a7c78

Please sign in to comment.