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

Unified Diff: pkg/kernel/lib/transformations/continuation.dart

Issue 2523673005: Enable strong-mode for pkg/kernel and fix some strong-mode warnings. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « pkg/kernel/bin/dartk.dart ('k') | pkg/kernel/test/batch_consistency.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/transformations/continuation.dart
diff --git a/pkg/kernel/lib/transformations/continuation.dart b/pkg/kernel/lib/transformations/continuation.dart
index 751e2ac365ddb01d3fabb5056c34ea5a25093776..fd6e1d2e5fe40da305da09ac84f56a27ab391769 100644
--- a/pkg/kernel/lib/transformations/continuation.dart
+++ b/pkg/kernel/lib/transformations/continuation.dart
@@ -153,7 +153,7 @@ class SyncStarFunctionRewriter extends ContinuationRewriterBase {
visitYieldStatement(YieldStatement node) {
var transformedExpression = node.expression.accept(this);
- var statements = [];
+ var statements = <Statement>[];
if (node.isYieldStar) {
var markYieldEach = new ExpressionStatement(new PropertySet(
new VariableGet(iteratorVariable),
@@ -498,9 +498,8 @@ abstract class AsyncRewriterBase extends ContinuationRewriterBase {
}
loopBody.add(
new IfStatement(cond, new Block(newBody), new BreakStatement(labeled)));
- labeled.body =
- new WhileStatement(new BoolLiteral(true), new Block(loopBody))
- ..parent = labeled;
+ labeled.body = new WhileStatement(
+ new BoolLiteral(true), new Block(loopBody))..parent = labeled;
statements.add(new Block(<Statement>[]
..addAll(temps)
..add(labeled)));
@@ -831,24 +830,28 @@ class HelperNodes {
}
throw 'Library "$name" not found';
}
+
Class findClass(Library library, String name) {
for (var klass in library.classes) {
if (klass.name == name) return klass;
}
throw 'Class "$name" not found';
}
+
Procedure findFactoryConstructor(Class klass, String name) {
for (var procedure in klass.procedures) {
if (procedure.isStatic && procedure.name.name == name) return procedure;
}
throw 'Factory constructor "$klass.$name" not found';
}
+
Constructor findConstructor(Class klass, String name) {
for (var constructor in klass.constructors) {
if (constructor.name.name == name) return constructor;
}
throw 'Constructor "$klass.$name" not found';
}
+
Procedure findProcedure(Library library, String name) {
for (var procedure in library.procedures) {
if (procedure.name.name == name ||
« no previous file with comments | « pkg/kernel/bin/dartk.dart ('k') | pkg/kernel/test/batch_consistency.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698