@Before public void setup() { ModuleHolder moduleHolder = new ModuleHolder("MethodsModule", false, false, false, false, new Provider<MethodsModule>() { MethodsModule mModule; @Override public MethodsModule get() { mModule = new MethodsModule(); return mModule; } }); mWrapper = new JavaModuleWrapper(null, MethodsModule.class, moduleHolder); mMethods = mWrapper.getMethodDescriptors(); PowerMockito.mockStatic(SoLoader.class); mArguments = PowerMockito.mock(ReadableNativeArray.class); }
@DoNotStrip public void invoke(ExecutorToken token, int methodId, ReadableNativeArray parameters) { if (mMethods == null || methodId >= mMethods.size()) { return; } mMethods.get(methodId).invoke(mJSInstance, token, parameters); }
@DoNotStrip public void invoke(ExecutorToken token, int methodId, ReadableNativeArray parameters) { if (mMethods == null || methodId >= mMethods.size()) { return; } mMethods.get(methodId).invoke(mCatalystInstance, token, parameters); }
private static void addExceptionInterface(EventBuilder eventBuilder, String type, String value, ReadableNativeArray stack) { StackTraceInterface stackTraceInterface = new StackTraceInterface(convertToNativeStacktrace(stack)); Deque<SentryException> exceptions = new ArrayDeque<>(); exceptions.push(new SentryException(value, type, "", stackTraceInterface)); eventBuilder.withSentryInterface(new ExceptionInterface(exceptions)); }
@ReactProp(name = PROP_VALID_AD_SIZES) public void setPropValidAdSizes(final ReactPublisherAdView view, final ReadableArray adSizeStrings) { ReadableNativeArray nativeArray = (ReadableNativeArray)adSizeStrings; ArrayList<Object> list = nativeArray.toArrayList(); String[] adSizeStringsArray = list.toArray(new String[list.size()]); AdSize[] adSizes = new AdSize[list.size()]; for (int i = 0; i < adSizeStringsArray.length; i++) { String adSizeString = adSizeStringsArray[i]; adSizes[i] = getAdSizeFromString(adSizeString); } view.setValidAdSizes(adSizes); }
public JSCJavaScriptExecutor(ReadableNativeArray jscConfig) { super(initHybrid(jscConfig)); }
@Before public void setup() { mMethods = new MethodsModule().getMethods(); PowerMockito.mockStatic(SoLoader.class); mArguments = PowerMockito.mock(ReadableNativeArray.class); }
static private Object fromReactArgument(Object object) { if (object instanceof ReadableNativeArray) return ((ReadableNativeArray) object).toArrayList(); else if (object instanceof ReadableNativeMap) return ((ReadableNativeMap) object).toHashMap(); else return null; }
@Override public native void invoke( CatalystInstance catalystInstance, ExecutorToken executorToken, ReadableNativeArray args);
@ReactProp(name = PROP_TEST_DEVICES) public void setPropTestDevices(final ReactPublisherAdView view, final ReadableArray testDevices) { ReadableNativeArray nativeArray = (ReadableNativeArray)testDevices; ArrayList<Object> list = nativeArray.toArrayList(); view.setTestDevices(list.toArray(new String[list.size()])); }
@ReactProp(name = PROP_TEST_DEVICES) public void setPropTestDevices(final ReactAdView view, final ReadableArray testDevices) { ReadableNativeArray nativeArray = (ReadableNativeArray)testDevices; ArrayList<Object> list = nativeArray.toArrayList(); view.setTestDevices(list.toArray(new String[list.size()])); }
@ReactMethod public void setTestDevices(ReadableArray testDevices) { ReadableNativeArray nativeArray = (ReadableNativeArray)testDevices; ArrayList<Object> list = nativeArray.toArrayList(); this.testDevices = list.toArray(new String[list.size()]); }
private native static HybridData initHybrid(ReadableNativeArray jscConfig);