diff --git a/doric-js/bundle/doric-vm.js b/doric-js/bundle/doric-vm.js index 923e71be..0ab17aae 100644 --- a/doric-js/bundle/doric-vm.js +++ b/doric-js/bundle/doric-vm.js @@ -4306,7 +4306,8 @@ function initNativeEnvironment(source) { }); break; case "invokeMethod": - console.log("invokeMethod", payload); + const callId = payload.callId; + console.log("invokeMethod", callId, payload); const values = payload.values; let args = []; for (let i = 0; i < values.length; i++) { @@ -4333,12 +4334,13 @@ function initNativeEnvironment(source) { const object = Reflect.get(global$1, payload.objectName); const method = Reflect.get(object, payload.functionName); const result = Reflect.apply(method, undefined, args); - console.log(result); + console.log("Result", callId, result); ws.send(JSON.stringify({ type: "D2C", cmd: 'invokeMethod', payload: { - result + result, + callId, } })); break; diff --git a/doric-js/index.debug.ts b/doric-js/index.debug.ts index 1b6d9bf2..75705611 100644 --- a/doric-js/index.debug.ts +++ b/doric-js/index.debug.ts @@ -92,7 +92,8 @@ async function initNativeEnvironment(source: string) { }) break case "invokeMethod": - console.log("invokeMethod", payload) + const callId = payload.callId; + console.log("invokeMethod", callId, payload) const values = payload.values as { type: number, value: string }[] let args = [] for (let i = 0; i < values.length; i++) { @@ -114,12 +115,13 @@ async function initNativeEnvironment(source: string) { const object = Reflect.get(global, payload.objectName as string) const method = Reflect.get(object, payload.functionName as string) const result = Reflect.apply(method, undefined, args) - console.log(result) + console.log("Result", callId, result) ws.send(JSON.stringify({ type: "D2C", cmd: 'invokeMethod', payload: { - result + result, + callId, } } as MSG)) break; diff --git a/doric-js/lib/index.debug.js b/doric-js/lib/index.debug.js index 40290862..aed844c3 100644 --- a/doric-js/lib/index.debug.js +++ b/doric-js/lib/index.debug.js @@ -98,7 +98,8 @@ function initNativeEnvironment(source) { }); break; case "invokeMethod": - console.log("invokeMethod", payload); + const callId = payload.callId; + console.log("invokeMethod", callId, payload); const values = payload.values; let args = []; for (let i = 0; i < values.length; i++) { @@ -125,12 +126,13 @@ function initNativeEnvironment(source) { const object = Reflect.get(global, payload.objectName); const method = Reflect.get(object, payload.functionName); const result = Reflect.apply(method, undefined, args); - console.log(result); + console.log("Result", callId, result); ws.send(JSON.stringify({ type: "D2C", cmd: 'invokeMethod', payload: { - result + result, + callId, } })); break;