File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
kernel/lib/transformations Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ class ContinuationVariables {
1616 static const awaitJumpVar = ':await_jump_var' ;
1717 static const awaitContextVar = ':await_ctx_var' ;
1818 static const asyncStackTraceVar = ':async_stack_trace' ;
19+ static const controllerStreamVar = ':controller_stream' ;
1920 static const exceptionParam = ':exception' ;
2021 static const stackTraceParam = ':stack_trace' ;
2122
@@ -919,7 +920,7 @@ class AsyncStarFunctionRewriter extends AsyncRewriterBase {
919920
920921 // dynamic :controller_stream;
921922 VariableDeclaration controllerStreamVariable =
922- new VariableDeclaration (":controller_stream" );
923+ new VariableDeclaration (ContinuationVariables .controllerStreamVar );
923924 statements.add (controllerStreamVariable);
924925
925926 setupAsyncContinuations (statements);
Original file line number Diff line number Diff line change @@ -390,6 +390,13 @@ class _ScopeBuilder extends RecursiveVisitor<Null> {
390390 _useVariable (_currentFrame.parent
391391 .getSyntheticVar (ContinuationVariables .awaitContextVar));
392392
393+ // Debugger looks for :controller_stream variable among captured
394+ // variables in a context, so make sure to capture it.
395+ if (_currentFrame.parent.dartAsyncMarker == AsyncMarker .AsyncStar ) {
396+ _useVariable (_currentFrame.parent
397+ .getSyntheticVar (ContinuationVariables .controllerStreamVar));
398+ }
399+
393400 if (locals.options.causalAsyncStacks &&
394401 (_currentFrame.parent.dartAsyncMarker == AsyncMarker .Async ||
395402 _currentFrame.parent.dartAsyncMarker ==
You can’t perform that action at this time.
0 commit comments