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

Unified Diff: lib/src/compiler.dart

Issue 1245013005: fixes #259, clone ast before mutation (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: revert dependency_overrides in pubspec Created 5 years, 5 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
Index: lib/src/compiler.dart
diff --git a/lib/src/compiler.dart b/lib/src/compiler.dart
index e7af8f7f37b394537c560af6d83790f81a1c0622..59b257353e413da710b755cc95640bc61a7224b9 100644
--- a/lib/src/compiler.dart
+++ b/lib/src/compiler.dart
@@ -128,19 +128,10 @@ class BatchCompiler extends AbstractCompiler {
if (_jsGen != null) {
var unit = units.first;
var parts = units.skip(1).toList();
-
- // TODO(jmesserly): this hack is to avoid compiling the same compilation
- // unit to JS twice. We mutate the AST, so it's not safe to run more than
- // once on the same unit.
- if (unit.getProperty(_propertyName) == true) return;
- unit.setProperty(_propertyName, true);
-
_jsGen.generateLibrary(new LibraryUnit(unit, parts));
}
}
- static const String _propertyName = 'dev_compiler.BatchCompiler.isCompiled';
-
void compileHtml(Source source) {
// TODO(jmesserly): reuse DartScriptsTask instead of copy/paste.
var contents = context.getContents(source);

Powered by Google App Engine
This is Rietveld 408576698