[wasm][debugger] Fix expression evaluation when it is a reference (#41135)
authorAnkit Jain <radical@gmail.com>
Sat, 22 Aug 2020 18:34:59 +0000 (14:34 -0400)
committerGitHub <noreply@github.com>
Sat, 22 Aug 2020 18:34:59 +0000 (14:34 -0400)
commitec59f65100d741539b00e308294cc53f04fc326b
treed4542e409b687f0c5f5f00c132ada918c514b89f
parent9f75120397c98c5d02231f8684cd2b192dfd4085
[wasm][debugger] Fix expression evaluation when it is a reference (#41135)

* [wasm][debugger] Fix expression evaluation when it is a reference

.. preceded by spaces. Eg: `"  foo.dateTime", or `"  foo.count"`

* Explanation of the fix:

- these particular expressions end up in the code path where we get a
SimpleMemberAccessExpression, and only one member access (like `a.b.c`)
was found.

- that code path had
    `return memberAccessValues[0]?["value"]?.Value<JObject>();`

  - which is incorrect, and we need to return `memberAccessValues[0]`,
  which is the value itself.
src/mono/wasm/debugger/BrowserDebugProxy/EvaluateExpression.cs
src/mono/wasm/debugger/BrowserDebugProxy/MonoProxy.cs
src/mono/wasm/debugger/DebuggerTestSuite/EvaluateOnCallFrameTests.cs