Issue 23446 in dart: Evaluating assignment expressions for local variables while debugging a web application yields an exception.

11 views
Skip to first unread message

da...@googlecode.com

unread,
May 13, 2015, 4:52:35 AM5/13/15
to bu...@dartlang.org
Status: New
Owner: ----
Labels: Type-Defect Priority-Unassigned

New issue 23446 by j...@boasit.dk: Evaluating assignment expressions for
local variables while debugging a web application yields an exception.
https://code.google.com/p/dart/issues/detail?id=23446

What steps will reproduce the problem?
1) Open Webstorm and create a 'Uber Simple Web Application' project
2) Edit web/main.dart such that main() is as follows

void main() {
int i = 42;

querySelector('#output').text = 'Your Dart app is running.';
}

I.e. we introduce a local variable to a function
3) Set a break point after the local variable declaration and run in debug
mode
4) When the breakpoint is reached, open evaluate expression in the IDE
(Menu/Run/Evaluate Expresssion)
5) Enter an assignment expression, e.g. 'i = 1337' and click Evaluate

What is the expected output? What do you see instead?
Expected:
The result of the evaluation is the value assigned to i

Actual:
The result is an exception:
Unhandled exception:
cannot assign to final variable 'i='.
NoSuchMethodError: cannot assign to final variable 'i='
#0 NoSuchMethodError._throwNew (dart:core-patch/errors_patch.dart:176)
#1 Eval.<anonymous closure> (evaluate:source:2:1)
#2 main (http://localhost:63342/untitled/web/main.dart:9:3)

What version of the product are you using?
Webstorm 10.0.2
Dart SDK: 1.11.0-dev.1.0_r45728 (ia32)

On what operating system?
Windows 7 SP1(64bit)

What browser (if applicable)?
Dartium build 45728.0 (ia32)

Please provide any additional information below.
This incident does not occur when running a similar program as a
commandline application



--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

da...@googlecode.com

unread,
May 13, 2015, 7:22:51 AM5/13/15
to bu...@dartlang.org
Updates:
Cc: ipo...@google.com

Comment #1 on issue 23446 by ri...@google.com: Evaluating assignment
expressions for local variables while debugging a web application yields an
exception.
https://code.google.com/p/dart/issues/detail?id=23446

Ivan: please triage this further to either dartium, vm or webstorm
integration

da...@googlecode.com

unread,
May 13, 2015, 12:15:06 PM5/13/15
to bu...@dartlang.org

Comment #2 on issue 23446 by hau...@google.com: Evaluating assignment
expressions for local variables while debugging a web application yields an
exception.
https://code.google.com/p/dart/issues/detail?id=23446

My guess is that the debugger stops at the = token, but the variable i is
not defined until after the initializer expression. The visibility of i is
defined by the language spec.

Even if you could assign to i at that breakpoint, the value would
immediately get overwritten by 42 when you continue executing the program.

Set your breakpoint after the declaration of i. That should work.

da...@googlecode.com

unread,
May 13, 2015, 12:20:36 PM5/13/15
to bu...@dartlang.org

Comment #3 on issue 23446 by hau...@google.com: Evaluating assignment
expressions for local variables while debugging a web application yields an
exception.
https://code.google.com/p/dart/issues/detail?id=23446

Sorry, I read too fast. You state that you put the breakpoint AFTER the
variable declaration, not on the same line. Then I'm stumped...

da...@googlecode.com

unread,
May 22, 2015, 9:37:07 AM5/22/15
to bu...@dartlang.org
Updates:
Status: Triaged
Labels: Area-VM

Comment #4 on issue 23446 by sand...@google.com: Evaluating assignment
expressions for local variables while debugging a web application yields an
exception.
https://code.google.com/p/dart/issues/detail?id=23446

Not sure if this is a vm debugger/evaluate issue, Webstorm issue, or
something third?

da...@googlecode.com

unread,
Jun 2, 2015, 5:50:14 PM6/2/15
to bu...@dartlang.org

Comment #5 on issue 23446 by rma...@google.com: Evaluating assignment
expressions for local variables while debugging a web application yields an
exception.
https://code.google.com/p/dart/issues/detail?id=23446

This is a Dartium issue masking a VM issue.

First Dartium is using Evaluate rather than EvaluateInFrame and evaluating
something like (final i){ return i = 1337; }(42)

Second the VM's implementation of EvaluateInFrame would evaluate something
like (i){ return i = 1337; }(42), which won't throw but still won't change
the value in the frame.
Reply all
Reply to author
Forward
0 new messages