|
Await always waits
The expression ‘await e’ always suspends the enclosing function. If e does not
evaluate to a an object o of type Future, a new Future is created using Future.value(o).
A small change in the backend allows a return instruction to be followed by
other instructions. In async functions, a return can suspend the function and the
continuation point is in the same code block after the return.
Other small changes:
- More user-friendly error message if async/await is not enabled.
- Programs no longer need to import dart:async when using async/await.
R=fschneider@google.com
Committed: https://code.google.com/p/dart/source/detail?r=41105
Total comments: 4
Total comments: 4
Total comments: 8
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+215 lines, -167 lines) |
Patch |
|
M |
runtime/vm/ast.h
|
View
|
1
2
3
4
5
|
2 chunks |
+19 lines, -28 lines |
0 comments
|
Download
|
|
M |
runtime/vm/ast_printer.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+15 lines, -4 lines |
0 comments
|
Download
|
|
M |
runtime/vm/ast_transformer.h
|
View
|
1
2
3
4
5
|
2 chunks |
+0 lines, -2 lines |
0 comments
|
Download
|
|
M |
runtime/vm/ast_transformer.cc
|
View
|
1
2
3
4
5
|
5 chunks |
+62 lines, -44 lines |
0 comments
|
Download
|
|
M |
runtime/vm/dart_api_impl.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+1 line, -3 lines |
0 comments
|
Download
|
|
M |
runtime/vm/flow_graph_builder.h
|
View
|
1
2
3
4
5
|
2 chunks |
+2 lines, -2 lines |
0 comments
|
Download
|
|
M |
runtime/vm/flow_graph_builder.cc
|
View
|
1
2
3
4
5
|
4 chunks |
+36 lines, -43 lines |
0 comments
|
Download
|
|
M |
runtime/vm/object.cc
|
View
|
1
2
3
4
5
|
1 chunk |
+2 lines, -0 lines |
0 comments
|
Download
|
|
M |
runtime/vm/object_store.h
|
View
|
1
2
3
4
5
|
3 chunks |
+14 lines, -0 lines |
0 comments
|
Download
|
|
M |
runtime/vm/object_store.cc
|
View
|
1
2
3
4
5
|
2 chunks |
+18 lines, -0 lines |
0 comments
|
Download
|
|
M |
runtime/vm/parser.h
|
View
|
1
2
3
4
5
|
2 chunks |
+1 line, -2 lines |
0 comments
|
Download
|
|
M |
runtime/vm/parser.cc
|
View
|
1
2
3
4
5
|
14 chunks |
+21 lines, -39 lines |
0 comments
|
Download
|
|
M |
runtime/vm/symbols.h
|
View
|
1
2
3
4
5
|
1 chunk |
+1 line, -0 lines |
0 comments
|
Download
|
|
A |
tests/language/await_nonfuture_test.dart
|
View
|
|
1 chunk |
+21 lines, -0 lines |
0 comments
|
Download
|
|
M |
tests/language/language.status
|
View
|
1
2
3
4
5
|
2 chunks |
+2 lines, -0 lines |
0 comments
|
Download
|
Total messages: 8 (1 generated)
|