Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ protected override async Task<bool> AcceptEvent(SessionId sessionId, string meth
await SendCommand(sessionId, "Debugger.resume", new JObject(), token);
return true;
}
case "mono_wasm_fire_debugger_agent_message":
case "_mono_wasm_fire_debugger_agent_message":
{
try {
Expand Down
8 changes: 5 additions & 3 deletions src/mono/wasm/runtime/src/mono/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export function mono_wasm_call_function_on(request: CallRequest) {

const objId = request.objectId;
const details = request.details;
let proxy;
let proxy: any = {};

if (objId.startsWith('dotnet:cfo_res:')) {
if (objId in _call_function_res_cache)
Expand All @@ -171,9 +171,11 @@ export function mono_wasm_call_function_on(request: CallRequest) {
}

const fn_args = request.arguments != undefined ? request.arguments.map(a => JSON.stringify(a.value)) : [];
const fn_eval_str = `var fn = ${request.functionDeclaration}; fn.call (proxy, ...[${fn_args}]);`;

const fn_res = eval(fn_eval_str);
const fn_body_template = `var fn = ${request.functionDeclaration}; return fn.apply(proxy, [${fn_args}]);`;
const fn_defn = new Function('proxy', fn_body_template);
const fn_res = fn_defn(proxy);

if (fn_res === undefined)
return { type: "undefined" };

Expand Down