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

@@ -1206,11 +1206,6 @@ var doric = (function (exports) {
context.hookBeforeNativeCall();
}
}
function hookAfterNativeCall(context) {
if (context) {
context.hookAfterNativeCall();
}
}
function getContext() {
return Reflect.getMetadata('__doric_context__', global$1);
}
@@ -1234,7 +1229,6 @@ var doric = (function (exports) {
}
hookBeforeNativeCall(context);
Reflect.apply(callback.resolve, context, argumentsList);
hookAfterNativeCall(context);
}
function jsCallReject(contextId, callbackId, args) {
const context = gContexts.get(contextId);
@@ -1253,7 +1247,6 @@ var doric = (function (exports) {
}
hookBeforeNativeCall(context);
Reflect.apply(callback.reject, context.entity, argumentsList);
hookAfterNativeCall(context);
}
class Context {
constructor(id) {
@@ -1392,7 +1385,6 @@ var doric = (function (exports) {
}
hookBeforeNativeCall(context);
const ret = Reflect.apply(Reflect.get(context.entity, methodName), context.entity, argumentsList);
hookAfterNativeCall(context);
return ret;
}
else {
@@ -1547,11 +1539,15 @@ var doric = (function (exports) {
return;
}
if (timerInfo.callback instanceof Function) {
setContext(timerInfo.context);
hookBeforeNativeCall(timerInfo.context);
Reflect.apply(timerInfo.callback, timerInfo.context, []);
hookAfterNativeCall(timerInfo.context);
}
}
function jsHookAfterNativeCall() {
const context = getContext();
context === null || context === void 0 ? void 0 : context.hookAfterNativeCall();
}
exports.Context = Context;
exports.__require__ = __require__;
@@ -1560,6 +1556,7 @@ var doric = (function (exports) {
exports.jsCallReject = jsCallReject;
exports.jsCallResolve = jsCallResolve;
exports.jsCallbackTimer = jsCallbackTimer;
exports.jsHookAfterNativeCall = jsHookAfterNativeCall;
exports.jsObtainContext = jsObtainContext;
exports.jsObtainEntry = jsObtainEntry;
exports.jsRegisterModule = jsRegisterModule;
@@ -2574,7 +2571,7 @@ class Panel {
const promises = [];
if (Environment.platform !== 'web') {
//Here insert a native call to ensure the promise is resolved done.
nativeEmpty();
//nativeEmpty()
if (this.__root__.isDirty()) {
const model = this.__root__.toModel();
promises.push(this.nativeRender(model));

File diff suppressed because one or more lines are too long