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

Unified Diff: dart/tests/try/web/incremental_compilation_update_test.dart

Issue 742043002: Incremental compilation of removed fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r41952 Created 6 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 | « dart/pkg/dart2js_incremental/lib/library_updater.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/try/web/incremental_compilation_update_test.dart
diff --git a/dart/tests/try/web/incremental_compilation_update_test.dart b/dart/tests/try/web/incremental_compilation_update_test.dart
index 0c88155a63bf25d082f9af48b3e2ca7fc95d19f4..995708a9d1b6b69843b0a6ced0a1e00eb82b372a 100644
--- a/dart/tests/try/web/incremental_compilation_update_test.dart
+++ b/dart/tests/try/web/incremental_compilation_update_test.dart
@@ -996,6 +996,61 @@ main() {
""",
const <String>['v2']),
],
+
+ // Test removing a field from a class works.
+ // TODO(ahe): The emitter still see the field, and we need to ensure that
+ // old names aren't used again.
+ const <ProgramResult>[
+ const ProgramResult(
+ r"""
+class A {
+ var x;
+}
+
+var instance;
+
+main() {
+ if (instance == null) {
+ instance = new A();
+ }
+ try {
+ instance.x = 'v1';
+ } catch(e) {
+ print('setter threw');
+ }
+ try {
+ print(instance.x);
+ } catch (e) {
+ print('getter threw');
+ }
+}
+""",
+ const <String>['v1']),
+ const ProgramResult(
+ r"""
+class A {
+}
+
+var instance;
+
+main() {
+ if (instance == null) {
+ instance = new A();
+ }
+ try {
+ instance.x = 'v1';
+ } catch(e) {
+ print('setter threw');
+ }
+ try {
+ print(instance.x);
+ } catch (e) {
+ print('getter threw');
+ }
+}
+""",
+ const <String>['setter threw', 'getter threw']),
+ ],
];
void main() {
@@ -1022,7 +1077,6 @@ Future compileAndRun(List<ProgramResult> programs) {
return listener.expect('iframe-ready').then((_) {
ProgramResult program = programs.first;
-
status.append(
new HeadingElement.h2()
..appendText("Full program #${testCount++}:"));
« no previous file with comments | « dart/pkg/dart2js_incremental/lib/library_updater.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698