js: bugfix, pure call context lost

This commit is contained in:
王劲鹏 2023-08-22 17:26:25 +08:00 committed by osborn
parent ff92ac5b16
commit 4dff854aa7
5 changed files with 5 additions and 1 deletions

File diff suppressed because one or more lines are too long

View File

@ -1431,6 +1431,7 @@ var doric = (function (exports) {
for (let i = 2; i < arguments.length; i++) { for (let i = 2; i < arguments.length; i++) {
argumentsList.push(arguments[i]); argumentsList.push(arguments[i]);
} }
hookBeforeNativeCall(context);
return Reflect.apply(Reflect.get(context.entity, methodName), context.entity, argumentsList); return Reflect.apply(Reflect.get(context.entity, methodName), context.entity, argumentsList);
} }
else { else {

View File

@ -1442,6 +1442,7 @@ function pureCallEntityMethod(contextId, methodName, args) {
for (let i = 2; i < arguments.length; i++) { for (let i = 2; i < arguments.length; i++) {
argumentsList.push(arguments[i]); argumentsList.push(arguments[i]);
} }
hookBeforeNativeCall(context);
return Reflect.apply(Reflect.get(context.entity, methodName), context.entity, argumentsList); return Reflect.apply(Reflect.get(context.entity, methodName), context.entity, argumentsList);
} }
else { else {

View File

@ -229,6 +229,7 @@ export function pureCallEntityMethod(contextId, methodName, args) {
for (let i = 2; i < arguments.length; i++) { for (let i = 2; i < arguments.length; i++) {
argumentsList.push(arguments[i]); argumentsList.push(arguments[i]);
} }
hookBeforeNativeCall(context);
return Reflect.apply(Reflect.get(context.entity, methodName), context.entity, argumentsList); return Reflect.apply(Reflect.get(context.entity, methodName), context.entity, argumentsList);
} }
else { else {

View File

@ -289,6 +289,7 @@ export function pureCallEntityMethod(contextId: string, methodName: string, args
for (let i = 2; i < arguments.length; i++) { for (let i = 2; i < arguments.length; i++) {
argumentsList.push(arguments[i]) argumentsList.push(arguments[i])
} }
hookBeforeNativeCall(context)
return Reflect.apply(Reflect.get(context.entity, methodName), context.entity, argumentsList) return Reflect.apply(Reflect.get(context.entity, methodName), context.entity, argumentsList)
} else { } else {
loge(`Cannot find method for context id:${contextId},method name is:${methodName}`) loge(`Cannot find method for context id:${contextId},method name is:${methodName}`)