Skip to content

[wasm][debugger] Support multidimensional indexing of object scheme #76062

Description

@ilonatommy

In MemberReferenceResolver.cs we are throwing

throw new InvalidOperationException($"Cannot apply indexing with [,] to an object of type '{type}'");

Remove it and fix it for e.g. testcase:

        [Fact]
        public async Task EvaluateObjectIndexingMultidimensional() => await CheckInspectLocalsAtBreakpointSite(
            "DebuggerTests.EvaluateLocalsWithIndexingTests", "EvaluateLocals", 12, "DebuggerTests.EvaluateLocalsWithIndexingTests.EvaluateLocals",
            "window.setTimeout(function() { invoke_static_method ('[debugger-test] DebuggerTests.EvaluateLocalsWithIndexingTests:EvaluateLocals'); })",
            wait_for_event_fn: async (pause_location) =>
           {
               var id = pause_location["callFrames"][0]["callFrameId"].Value<string>();

               await EvaluateOnCallFrameAndCheck(id,
                   ("f[\'a\', \'&\']", TString("a-&"))
                );
           });
public class TestEvaluate
{
    public string this[char key1, char key2] => $"{key1}-{key2}";
}

and similar. Make sure that not only numeric indexes are supported but other schemes (as above: char) as well.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions