Skip to content

Commit

Permalink
js: bugfix, pure call context lost
Browse files Browse the repository at this point in the history
  • Loading branch information
jingpeng authored and penfeizhou committed Aug 22, 2023
1 parent ff92ac5 commit 4dff854
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 1 deletion.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions doric-js/bundle/doric-sandbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -1431,6 +1431,7 @@ var doric = (function (exports) {
for (let i = 2; i < arguments.length; i++) {
argumentsList.push(arguments[i]);
}
hookBeforeNativeCall(context);
return Reflect.apply(Reflect.get(context.entity, methodName), context.entity, argumentsList);
}
else {
Expand Down
1 change: 1 addition & 0 deletions doric-js/bundle/doric-vm.js
Original file line number Diff line number Diff line change
Expand Up @@ -1442,6 +1442,7 @@ function pureCallEntityMethod(contextId, methodName, args) {
for (let i = 2; i < arguments.length; i++) {
argumentsList.push(arguments[i]);
}
hookBeforeNativeCall(context);
return Reflect.apply(Reflect.get(context.entity, methodName), context.entity, argumentsList);
}
else {
Expand Down
1 change: 1 addition & 0 deletions doric-js/lib/src/runtime/sandbox.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ export function pureCallEntityMethod(contextId, methodName, args) {
for (let i = 2; i < arguments.length; i++) {
argumentsList.push(arguments[i]);
}
hookBeforeNativeCall(context);
return Reflect.apply(Reflect.get(context.entity, methodName), context.entity, argumentsList);
}
else {
Expand Down
1 change: 1 addition & 0 deletions doric-js/src/runtime/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ export function pureCallEntityMethod(contextId: string, methodName: string, args
for (let i = 2; i < arguments.length; i++) {
argumentsList.push(arguments[i])
}
hookBeforeNativeCall(context)
return Reflect.apply(Reflect.get(context.entity, methodName), context.entity, argumentsList)
} else {
loge(`Cannot find method for context id:${contextId},method name is:${methodName}`)
Expand Down

0 comments on commit 4dff854

Please sign in to comment.