Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Evaluate expression does not support scope #1336

Closed
jacob314 opened this issue Jun 10, 2021 · 2 comments · Fixed by #1340
Closed

Evaluate expression does not support scope #1336

jacob314 opened this issue Jun 10, 2021 · 2 comments · Fixed by #1340
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)

Comments

@jacob314
Copy link
Member

See the optional scope parameter from the evaluate method.
https://github.com/dart-lang/sdk/blob/master/runtime/vm/service/service.md#evaluate
It appears to be ignored on the web

Repro:
Evaluate expression
"object is Element || object is RenderObj"
where scope is {'object', validInstanceRefId}

Result:
[ErrorRef id: 2062, kind: error, message: CompilationError: Getter not found: 'object'.

@jacob314 jacob314 added the type-bug Incorrect behavior (everything from a crash to more subtle misbehavior) label Jun 10, 2021
@annagrin annagrin added this to To do in Expression evaluation in web debugger via automation Jun 10, 2021
@annagrin annagrin added the P1 A high priority bug; for example, a single project is unusable or has many test failures label Jun 10, 2021
@annagrin
Copy link
Contributor

Idea: modify the evaluate() with scope to compile (scope) => expression to jsExpression and then send Runtime.callFunctionOn(jsExpression, [scopeIds]) to chrome.

@jacob314
Copy link
Member Author

That is what the polyfill for scope I've temporarily added to DevTools does. flutter/devtools#3112

annagrin pushed a commit to annagrin/webdev that referenced this issue Jun 11, 2021
Support evaluate with scope by
- wrapping the expression in a function with scope keys as parameters
- compiling the wrapper
- and using chrome's Runtime.callFunctionOn to evaluate the compiled
  call with arguments

Will be followed up with a cleanup of try/catch additions and removals.

Closes:  dart-lang#1336
annagrin pushed a commit to annagrin/webdev that referenced this issue Jun 15, 2021
Support evaluate with scope by
- wrapping the expression in a function with scope keys as parameters
- compiling the wrapper
- and using chrome's Runtime.callFunctionOn to evaluate the compiled
  call with arguments

Will be followed up with a cleanup of try/catch additions and removals.

Closes:  dart-lang#1336
annagrin pushed a commit to annagrin/webdev that referenced this issue Jul 8, 2021
Support evaluate with scope by
- wrapping the expression in a function with scope keys as parameters
- compiling the wrapper
- and using chrome's Runtime.callFunctionOn to evaluate the compiled
  call with arguments

Will be followed up with a cleanup of try/catch additions and removals.

Closes:  dart-lang#1336
annagrin pushed a commit to annagrin/webdev that referenced this issue Jul 13, 2021
Support evaluate with scope by
- wrapping the expression in a function with scope keys as parameters
- compiling the wrapper
- and using chrome's Runtime.callFunctionOn to evaluate the compiled
  call with arguments

Will be followed up with a cleanup of try/catch additions and removals.

Closes:  dart-lang#1336
annagrin pushed a commit to annagrin/webdev that referenced this issue Jul 21, 2021
Support evaluate with scope by
- wrapping the expression in a function with scope keys as parameters
- compiling the wrapper
- and using chrome's Runtime.callFunctionOn to evaluate the compiled
  call with arguments

Will be followed up with a cleanup of try/catch additions and removals.

Closes:  dart-lang#1336
Expression evaluation in web debugger automation moved this from To do to Done Jul 21, 2021
annagrin pushed a commit that referenced this issue Jul 21, 2021
* Support scope in ChromeProxyService.evaluate()

Support evaluate with scope by
- wrapping the expression in a function with scope keys as parameters
- compiling the wrapper
- and using chrome's Runtime.callFunctionOn to evaluate the compiled
  call with arguments

Will be followed up with a cleanup of try/catch additions and removals.

Closes:  #1336

* Build

* Minor fixes and rebuild

* Addressed CR comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1 A high priority bug; for example, a single project is unusable or has many test failures type-bug Incorrect behavior (everything from a crash to more subtle misbehavior)
Development

Successfully merging a pull request may close this issue.

2 participants