Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(629)

Unified Diff: runtime/vm/parser.cc

Issue 1073623002: Fix spurious resume when awaiting future in async* code (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« runtime/lib/core_patch.dart ('K') | « runtime/vm/parser.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
===================================================================
--- runtime/vm/parser.cc (revision 44981)
+++ runtime/vm/parser.cc (working copy)
@@ -8310,6 +8310,23 @@
}
+// Build an AST node for static call to Dart function print(str).
+// Used during debugging to insert print in generated dart code.
+AstNode* Parser::DartPrint(const char* str) {
+ const Library& lib = Library::Handle(Library::CoreLibrary());
+ const Function& print_fn = Function::ZoneHandle(
+ Z, lib.LookupFunctionAllowPrivate(Symbols::print()));
+ ASSERT(!print_fn.IsNull());
+ ArgumentListNode* one_arg = new(Z) ArgumentListNode(Scanner::kNoSourcePos);
+ String& msg = String::Handle(String::NewFormatted("%s", str));
+ one_arg->Add(new(Z) LiteralNode(Scanner::kNoSourcePos,
+ String::ZoneHandle(Symbols::New(msg))));
+ AstNode* print_call =
+ new(Z) StaticCallNode(Scanner::kNoSourcePos, print_fn, one_arg);
+ return print_call;
+}
+
+
AstNode* Parser::ParseAwaitForStatement(String* label_name) {
TRACE_PARSER("ParseAwaitForStatement");
ASSERT(IsAwaitKeyword());
@@ -8477,7 +8494,6 @@
loop_var_assignment_pos);
ASSERT(loop_var_assignment != NULL);
}
-
current_block_->statements->Add(loop_var_assignment);
// Now parse the for-in loop statement or block.
« runtime/lib/core_patch.dart ('K') | « runtime/vm/parser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698