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

Unified Diff: lib/src/codegen/js_codegen.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/codegen/js_codegen.dart
diff --git a/lib/src/codegen/js_codegen.dart b/lib/src/codegen/js_codegen.dart
index 76b0832f9e5296ec76d8147f74d95d54a05cee3e..08b43262ada627d8a6b60442cc7f66f941a0a585 100644
--- a/lib/src/codegen/js_codegen.dart
+++ b/lib/src/codegen/js_codegen.dart
@@ -2802,6 +2802,8 @@ class JSGenerator extends CodeGenerator {
}
String generateLibrary(LibraryUnit unit) {
+ // Clone the AST first, so we can mutate it.
+ unit = unit.clone();
var library = unit.library.element.library;
var fields = findFieldsNeedingStorage(unit);
var codegen =

Powered by Google App Engine
This is Rietveld 408576698