This repository was archived by the owner on Feb 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +7
-20
lines changed
test/codegen/expect/sunflower Expand file tree Collapse file tree 4 files changed +7
-20
lines changed Original file line number Diff line number Diff line change @@ -1767,9 +1767,9 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ClosureAnnotator {
17671767 @override
17681768 JS .Block visitBlockFunctionBody (BlockFunctionBody node) {
17691769 var initArgs = _emitArgumentInitializers (node.parent);
1770- var block = visitBlock (node.block) ;
1771- if (initArgs != null ) return new JS . Block ([initArgs, block] );
1772- return block ;
1770+ var stmts = _visitList (node.block.statements) as List < JS . Statement > ;
1771+ if (initArgs != null ) stmts. insert ( 0 , initArgs );
1772+ return new JS . Block (stmts) ;
17731773 }
17741774
17751775 @override
@@ -2932,7 +2932,8 @@ class JSCodegenVisitor extends GeneralizingAstVisitor with ClosureAnnotator {
29322932 }
29332933 }
29342934
2935- body.add (_visit (node.body));
2935+ body.add (
2936+ new JS .Block (_visitList (node.body.statements) as List <JS .Statement >));
29362937 _catchParameter = savedCatch;
29372938 return _statement (body);
29382939 }
Original file line number Diff line number Diff line change @@ -173,20 +173,6 @@ class BatchCompiler extends AbstractCompiler {
173173 }
174174
175175 if (_jsGen != null ) {
176- // TODO(jmesserly): full incremental support would avoid checking as well,
177- // however, we'd lose compiler messages in that case.
178-
179- // Note: analyzer's modification stamp is millisecondsSinceEpoch
180- int lastModifyTime = unitElements
181- .map ((e) => context.getModificationStamp (e.source))
182- .reduce (math.max);
183- var outFile = new File (getOutputPath (library.source.uri));
184- if (outFile.existsSync () &&
185- outFile.lastModifiedSync ().millisecondsSinceEpoch >= lastModifyTime) {
186- // Output already up to date.
187- return ;
188- }
189-
190176 var unit = units.first;
191177 var parts = units.skip (1 ).toList ();
192178 _jsGen.generateLibrary (new LibraryUnit (unit, parts));
Original file line number Diff line number Diff line change @@ -285,7 +285,7 @@ class Block extends Statement {
285285 Block (this .statements, {this .isScope: false }) {
286286 assert (! statements.any ((s) => s is ! Statement ));
287287 }
288- Block .empty () : this . statements = < Statement > [];
288+ Block .empty () : statements = < Statement > [], isScope = false ;
289289
290290 accept (NodeVisitor visitor) => visitor.visitBlock (this );
291291 void visitChildren (NodeVisitor visitor) {
Original file line number Diff line number Diff line change @@ -51,8 +51,8 @@ <h1>drfibonacci's Sunflower Spectacular</h1>
5151< script src ="../dev_compiler/runtime/dart/mirrors.js "> </ script >
5252< script src ="../dev_compiler/runtime/dart/_js_mirrors.js "> </ script >
5353< script src ="../dev_compiler/runtime/dart/js.js "> </ script >
54- < script src ="dom.js "> </ script >
5554< script src ="circle.js "> </ script >
55+ < script src ="dom.js "> </ script >
5656< script src ="painter.js "> </ script >
5757< script src ="sunflower.js "> </ script >
5858< script > dart_library . start ( 'sunflower/sunflower' ) ; </ script >
You can’t perform that action at this time.
0 commit comments