Remove nativeEmpty, check call change to native side

This commit is contained in:
pengfei.zhou
2021-09-16 11:53:32 +08:00
committed by osborn
parent 3d3f646845
commit dd4e8db3ad
20 changed files with 72 additions and 93 deletions

View File

@@ -176,12 +176,6 @@ public class DoricJSEngine implements Handler.Callback, DoricTimerExtension.Time
return null;
}
});
mDoricJSE.injectGlobalJSFunction(DoricConstant.INJECT_EMPTY, new JavaFunction() {
@Override
public JavaValue exec(JSDecoder[] args) {
return null;
}
});
mDoricJSE.injectGlobalJSFunction(DoricConstant.INJECT_REQUIRE, new JavaFunction() {
@Override
public JavaValue exec(JSDecoder[] args) {
@@ -292,8 +286,10 @@ public class DoricJSEngine implements Handler.Callback, DoricTimerExtension.Time
for (Object arg : args) {
values.add(DoricUtils.toJavaValue(arg));
}
return mDoricJSE.invokeMethod(DoricConstant.GLOBAL_DORIC, method,
JSDecoder ret = mDoricJSE.invokeMethod(DoricConstant.GLOBAL_DORIC, method,
values.toArray(new JavaValue[0]), false);
mDoricJSE.invokeMethod(DoricConstant.GLOBAL_DORIC, DoricConstant.DORIC_HOOK_NATIVE_CALL, new JavaValue[0], false);
return ret;
}
@Override

View File

@@ -33,7 +33,6 @@ public class DoricConstant {
public static final String INJECT_TIMER_SET = "nativeSetTimer";
public static final String INJECT_TIMER_CLEAR = "nativeClearTimer";
public static final String INJECT_BRIDGE = "nativeBridge";
public static final String INJECT_EMPTY = "nativeEmpty";
public static final String TEMPLATE_CONTEXT_CREATE = "Reflect.apply(" +
"function(doric,context,Entry,require,exports){" + "\n" +
@@ -64,6 +63,7 @@ public class DoricConstant {
public static final String DORIC_TIMER_CALLBACK = "jsCallbackTimer";
public static final String DORIC_BRIDGE_RESOLVE = "jsCallResolve";
public static final String DORIC_BRIDGE_REJECT = "jsCallReject";
public static final String DORIC_HOOK_NATIVE_CALL = "jsHookAfterNativeCall";
public static final String DORIC_ENTITY_RESPONSE = "__response__";