Chromium Code Reviews| Index: pkg/kernel/lib/transformations/continuation.dart |
| diff --git a/pkg/kernel/lib/transformations/continuation.dart b/pkg/kernel/lib/transformations/continuation.dart |
| index 112ea43b8274b3f3e182cc2e99039834e589fcb6..6c0f0f10c721a957e9448e91ccdd2c38cc86842b 100644 |
| --- a/pkg/kernel/lib/transformations/continuation.dart |
| +++ b/pkg/kernel/lib/transformations/continuation.dart |
| @@ -198,6 +198,8 @@ abstract class AsyncRewriterBase extends ContinuationRewriterBase { |
| new VariableDeclaration(":async_op_then"); |
| final VariableDeclaration catchErrorContinuationVariable = |
| new VariableDeclaration(":async_op_error"); |
| + final VariableDeclaration asyncStackTrace = |
| + new VariableDeclaration(":async_stack_trace"); |
| LabeledStatement labeledBody; |
| @@ -215,6 +217,9 @@ abstract class AsyncRewriterBase extends ContinuationRewriterBase { |
| // var :async_op_error; |
| statements.add(catchErrorContinuationVariable); |
| + // var :async_stack_trace; |
| + statements.add(asyncStackTrace); |
| + |
| // :async_op([:result, :exception, :stack_trace]) { |
| // modified <node.body>; |
| // } |
| @@ -258,6 +263,13 @@ abstract class AsyncRewriterBase extends ContinuationRewriterBase { |
| new VariableSet( |
| catchErrorContinuationVariable, boundCatchErrorClosure)); |
| statements.add(catchErrorClosureVariableAssign); |
| + |
| + // :async_stack_trace = _asyncStackTraceHelper(); |
|
kustermann
2017/02/14 14:45:53
nit: double space after =
jensj
2017/02/15 11:29:53
Done.
|
| + final boundAsyncStackTrace = new StaticInvocation( |
| + helper.asyncStackTraceHelper, new Arguments.empty()); |
| + final asyncStackTraceVariableAssign = new ExpressionStatement( |
| + new VariableSet(asyncStackTrace, boundAsyncStackTrace)); |
| + statements.add(asyncStackTraceVariableAssign); |
| } |
| Statement buildWrappedBody() { |
| @@ -874,6 +886,7 @@ class HelperNodes { |
| final Constructor streamIteratorConstructor; |
| final Procedure asyncThenWrapper; |
| final Procedure asyncErrorWrapper; |
| + final Procedure asyncStackTraceHelper; |
| final Procedure awaitHelper; |
| final CoreTypes coreTypes; |
| @@ -891,6 +904,7 @@ class HelperNodes { |
| this.streamControllerConstructor, |
| this.asyncThenWrapper, |
| this.asyncErrorWrapper, |
| + this.asyncStackTraceHelper, |
| this.awaitHelper, |
| this.coreTypes); |
| @@ -973,6 +987,7 @@ class HelperNodes { |
| findConstructor(streamControllerClass, ''), |
| findProcedure(asyncLibrary, '_asyncThenWrapperHelper'), |
| findProcedure(asyncLibrary, '_asyncErrorWrapperHelper'), |
| + findProcedure(asyncLibrary, '_asyncStackTraceHelper'), |
| findProcedure(asyncLibrary, '_awaitHelper'), |
| new CoreTypes(program)); |
| } |